Install Sphinx on ubuntu

install git

sudo apt-get install git git-core compiz-dev


install gems

sudo gem install rspec hoe

git clone git://github.com/freelancing-god/not-a-mock.git
cd not-a-mock
rake gem
sudo gem install pkg/not_a_mock-1.1.0.gem

git clone git://github.com/freelancing-god/ginger.git
cd ginger
rake gem
sudo gem install pkg/ginger-1.1.0.gem

sudo gem install cucumber
sudo gem install win32console
sudo gem install will_paginate
 

install mysql_config
mysql_config 是一个生成 mysql 配置命令, apt安装mysql没有这个命令
sudo apt-get install libmysqlclient15-dev


install sphinx
wget http://www.sphinxsearch.com/downloads/sphinx-0.9.8.1.tar.gz
tar zxvf sphinx-0.9.8.1.tar.gz
cd sphinx-0.9.8.1
make 
sudo make install

sudo cp /usr/local/etc/sphinx.conf.dist /usr/local/etc/sphinx.conf
# 修改数据库配置
seamless_rotate = 0
# 编码
charset_type  = utf-8
#  指定utf-8的编码表
charset_table  = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F
# 简单分词,只支持0和1,如果要搜索中文,请指定为1
ngram_len    = 1
# 需要分词的字符,如果要搜索中文,去掉前面的注释
ngram_chars   = U+3000..U+2FA1F

sudo mkdir /var/data
indexer --all
search test # => sphinx 正常


  

你可能感兴趣的:(java,mysql,git,ubuntu,rspec)