CentOS7安装coreseek


安装

yum install expat-devel*
cd /usr/local/src
wget http://pppboy.com/wp-content/uploads/2016/02/coreseek-3.2.14.tar.gz
tar xzvf coreseek-3.2.14.tar.gz
cd coreseek-3.2.14
cd mmseg-3.2.14
./bootstrap
./configure –prefix=/usr/local/mmseg3
make && make install
cd ..
cd csft-3.2.14
wget -O – http://pppboy.com/wp-content/uploads/2016/02/sphinxexpr-gcc4.7.patch_.gz | gzip -d – | patch -p0
#或者
直接修改src/sphixexpr.cpp文件的1746, 1777和1823行,将三行中的ExprEval改为this->ExprEval
#参考http://blog.atime.me/note/sphinx-coreseek-summary.html
sh buildconf.sh
./configure –prefix=/usr/local/coreseek –without-unixodbc –with-mmseg –with-mmseg-includes=/usr/local/mmseg3/include/mmseg/ –with-mmseg-libs=/usr/local/mmseg3/lib/ –with-mysql
make && make install
cd ..
cd testpack
cat var/test/test.xml #此时应该正确显示中文
/usr/local/mmseg3/bin/mmseg -d /usr/local/mmseg3/etc var/test/test.xml
/usr/local/coreseek/bin/indexer -c etc/csft.conf –all
/usr/local/coreseek/bin/search -c etc/csft.conf

开启服务

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

停止服务

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

已启动服务,更新索引

/usr/local/coreseek/bin/indexer -c etc/csft.conf –all –rotate

常见问题

Sphinx的查询默认最大记录数是:1000,而我们想更改这个数值。就需要更改三个地方。

  1. 是更改sphinx.conf配置文件的:max_matches = 10000 #后面数字就是你想查询的最大记录数。建议在1000~10000之内。
  2. 是在api调用时,$cl->SetLimits($pageStart, $pageSize, $max_limits);
  3. 用SetLimits的第三个参数更改为你想要的显示最大记录数。
  4. 修改sphinxclient.php 中max_matches
Last Updated:
Contributors: huangyanfu