关于Coreseek的一些命令
Coreseek的详细安装其官网上都有详细介绍,在这里只列出一些常见操作命令。(以下操作均在win7系统下实现)
1. 将Sphinx添加为Windows服务,服务名为SphinxSearc。
(其中路径要替换为你Coreseek实际路径)
e:\coreseek\bin\searchd --install --config e:\coreseek\etc\csft_mysql.conf --servicename SphinxSearch
--- 启动/关闭服务
net start/stop SphinxSearch
--- 删除服务
sc delete SphinxSearch
--- 也可直接启动
e:\coreseek\bin\searchd -c e:\coreseek\etc\csft_mysql.conf
2. 建立索引文件
coreseek\bin\indexer -c E:\coreseek\etc\csft_mysql.conf --all --- 所有的
coreseek\bin\indexer mysql -c E:\coreseek\etc\csft_mysql.conf --- 指定索引(mysql、xml)
3. 搜索数据
coreseek\bin\search -c E:\coreseek\etc\csft_mysql.conf -a keyword
coreseek\bin\search keyword -c E:\coreseek\etc\csft_mysql.conf
--- 中文搜素
echo 网络 | iconv -f gbk -t utf-8 | search -c E:\coreseek\etc\csft_mysql.conf --stdin | iconv -f utf-8 -t gbk
4. 轮换索引。
对新的文档建立索引时几乎肯定都确保搜索服务仍然可用,除非你有信心在搜索服务停止同时不给你的用户带来困扰。--rotate建立一个额外的索引,并列于原有索引(与原有索引在相同目录,简单地在原有索引文件名基础上加一个.new后缀)。一旦这个额外的索引建立完成,indexer给searchd发一个SIGHUP信号做为通知。searchd会尝试将索引重新命名(给原有索引加上.old后缀,而把带有.new后缀的新索引改为原名,以达替换之目的),继而用新的文件重启服务。
coreseek\bin\indexer mysql -c E:\coreseek\etc\csft_mysql.conf --rotate --all
coreseek\bin\indexer mysql -c E:\coreseek\etc\csft_mysql.conf --rotate