1、安裝Python支持(以下針對CentOS系統,其他Linux系統請使用相應的方法安裝)
yum install -y python Python-devel
2、編譯安裝LibMMSeg(LibMMSeg是為Sphinx全文搜索引擎設計的中文分詞軟件包,其在GPL協議下發行的中文分詞法,采用Chih-Hao Tsai的MMSEG算法。LibMMSeg在本文中用來生成中文分詞詞庫。)
以下壓縮包“sphinx-0.9.8-rc2-chinese.zip”中包含mmseg-0.7.3.tar.gz、sphinx-0.9.8-rc2.tar.gz以及中文分詞補丁。
點擊這裡下載文件
unzip sphinx-0.9.8-rc2-chinese.zip
tar zxvf mmseg-0.7.3.tar.gz
cd mmseg-0.7.3/
./configure
make
make install
cd ../
3、編譯安裝MySQL 5.1.26-rc、Sphinx、SphinxSE存儲引擎
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.26-rc.tar.gz/from/http://mirror.x10.com/mirror/MySQL/
tar zxvf MySQL-5.1.26-rc.tar.gz
tar zxvf sphinx-0.9.8-rc2.tar.gz
cd sphinx-0.9.8-rc2/
patch -p1 < ../sphinx-0.98rc2.zhcn-support.patch
patch -p1 < ../fix-crash-in-excerpts.patch
cp -rf mysqlse ../MySQL-5.1.26-rc/storage/sphinx
cd ../
cd MySQL-5.1.26-rc/
sh BUILD/autorun.sh
./configure --with-plugins=sphinx --prefix=/usr/local/MySQL-search/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-clIEnt --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile
make && make install
cd ../
cd sphinx-0.9.8-rc2/
CPPFLAGS=-I/usr/include/Python2.4
LDFLAGS=-lPython2.4
./configure --prefix=/usr/local/sphinx --with-mysql=/usr/local/MySQL-search
make
make install
cd ../
mv /usr/local/sphinx/etc/sphinx.conf /usr/local/sphinx/
etc/sphinx.conf.old