Ubuntu Sphinx 配置

前端之家收集整理的这篇文章主要介绍了Ubuntu Sphinx 配置前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

配置步骤

1. 安装 sphinx

sudo apt-get install aptitude
sudo aptitude install sphinx3 sphinx3-doc sphinxsearch sphinx-common -y
sudo aptitude install libsphinxclient-dev libsphinxclient-0.0.1 -y
sudo apt-get install PHP-pear PHP5-dev
sudo pecl install sphinx

2. 修改 PHP.ini 扩展

PHP5-fpm -i|grep ini
sudo vim /etc/PHP5/fpm/PHP.ini

添加 extension=sphinx.so 并重启:

extension=sphinx.so
sudo service PHP5-fpm restart

3. 索引配置

cd /etc/sphinxsearch
sudo vi sphinx.conf 
...
...

4. 生成 sphinx 索引

sudo indexer -c sphinx.conf test1  --all
sudo indexer -c /etc/sphinxsearch/sphinx.conf test1
sudo indexer -c /etc/sphinxsearch/sphinx.conf test2

5. 停止/启动 sphinx

sudo service sphinxsearch restart
或
sudo pkill -f searchd 
sudo searchd -c sphinx.conf

测试

sudo search -c sphinx.conf -i test1 Assistant
sudo search -c sphinx.conf -i test2 Assistant
原文链接:https://www.f2er.com/ubuntu/355696.html

猜你在找的Ubuntu相关文章