coreseek安装使用

从源码编译安装:

wget http://www.coreseek.cn/uploads/csft/3.2/coreseek-3.2.14.tar.gz
tar vxzf coreseek-3.2.14.tar.gz
cd coreseek-3.2.14

#安装coreseek开发的mmseg,为coreseek提供中文分词功能
cd mmseg-3.2.14/
sudo apt-get install automake libtool
./bootstrap
##ubuntu环境下,需要使用ACLOCAL_FLAGS="-I /usr/share/aclocal" ./bootstrap
./configure --prefix=/usr/local/mmseg3
make
sudo make install

#安装coreseek:
cd ../csft-3.2.14
sh buildconf.sh
./configure --prefix=/usr/local/coreseek --with-python --without-unixodbc --with-mmseg --with-mmseg-includes=/usr/local/mmseg3/include/mmseg/ --with-mmseg-libs=/usr/local/mmseg3/lib/ --with-mysql
make
sudo make install

如果你的gcc>=4.7安装的过程中:会make编译不通过,提示: error: ‘ExprEval’ was not declared in this scope
解决办法:
找到src/sphinxexpr.cpp里面的代码
ExprEval ( this->m_pArg, tMatch );
替换为
this->ExprEval ( this->m_pArg, tMatch );

安装完后,配置好配置文件,先生成索引:

/usr/local/coreseek/bin/indexer -c /usr/local/coreseek/etc/你的配置文件.conf --all

如果只想索引某个数据库,则把参数 –all换成数据源的名称:

/usr/local/coreseek/bin/indexer -c /usr/local/coreseek/etc/sku.conf 索引名称(这里的索引名称是你在sphinx.conf中定义的索引名称)

再开启搜索服务:

sudo /usr/local/coreseek/bin/searchd -c /usr/local/coreseek/etc/sku.conf

测试搜索:

/usr/local/coreseek/bin/search -c etc/csft.conf -a 搜索关键词

如要停止搜索服务:

/usr/local/coreseek/bin/searchd -c etc/csft.conf --stop

资料:

Sphinx速成指南 http://sphinxsearch.com/wiki/doku.php?id=sphinx_chinese_tutorial

coreseek官方安装文档 http://www.coreseek.cn/products-install/install_on_bsd_linux/