使用sphinx 需要注意以下几件事情:
1
.首先要有数据
2
.建立Sphinx 配置文件
3
.生成索引
4
.启动Searchd 服务进程,并开户端口
9312
5
.用php 客户端去连接sphinx
Coreseek(带有中文分词的sphinx) 的安装:
#wget http:
//www.coreseek.cn/uploads/csft/3.2/coreseek-3.2.14.tar.gz
#tar -zxpf coreseek-
3.2
.
14
.tar.gz
1
.安装mmseg
#cd mmseg-
3.2
.
14
#./configure --prefix=/usr/local/mmseg
//出现错误config.status: error: cannot find input file: src/Makefile.
in
时候执行
#aclocal
#libtoolize --force
#automake --add-missing
#autoconf
#autoheader
#make clean
#./configure --prefix=/usr/local/mmseg
#make && make install
2.安装csft(sphinx)
#cd ../csft-4.1/
#sh buildconf.sh
#./configure --prefix=/usr/local/coreseek --with-mysql=/usr/local/mysql --with-mmseg=/usr/local/mmseg --with-mmseg-includes=/usr/local/mmseg/include/mmseg/ --with-mmseg-libs=/usr/local/mmseg/lib/
# make && make install
php连接sphinx
安装sphinx 连接客户端
#cd . /coreseek-3.2.14/csft-3.2.14/api/libsphinxclient
#make && make install
下载php 连接sphinx 连接程序
#wget http://pecl.php.net/get/sphinx-1.3.2.tgz
#tar -zxvf sphinx-1.3.2.tgz
#cd sphinx-1.3.2
#./configure --with-php-config=/usr/local/php/bin/php-config --with-sphinx
#make && make install
在php.ini 里面加入extension=sphinx.so