Sphinx-实战

配置完成后, 有了数据源、索引文件存储位置等, 便可以使用 indexer 工具创建索引, 收集要被检索的数据

-c 指定配置文件 默认使用 etc/sphinx.conf

--all 对所有索引重新编制索引

--retate 用于轮换索引, 主要是在不停止 searchd 服务的情况下增加索引

--merge 合并索引, 用于把增量索引合并到主索引

cd /usr/local/sphinx/bin
./indexer --all

如果出现./indexer: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory, 可以使用以下命令解决找不到的问题

vim /etc/ld.so.conf
#添加 /usr/local/mysql/lib 到文件底部
ldconfig

如果Sphinx要作为服务运行, 需要使用searchd

-c 指定配置文件

--stop 停止服务

--pidfile 指定PID文件

-p 指定端口 默认是9312端口

原文地址:https://www.cnblogs.com/JohnABC/p/4730728.html