资 源 简 介
在phpcms中应用sphinx全文索引
一、首先需要在服务器上安装sphinx
二、升级phpcms search模块
载升级包直接覆盖search模块目录
## 三、设置计划任务更新索引 ##
### 1.windows下 ###
#需要设置计划任务
#凌晨4点合并索引,执行merge.bat
#其余时间每分钟更新索引,执行delta.bat
merge.bat
@ECHO offD:sphinxinindexer.exe --config D:sphinxsphinx.conf --merge main delta --rotateecho indexing, window will close when complete
delta.bat
@ECHO offD:sphinxinindexer.exe --config D:sphinxsphinx.conf delta --rotateecho indexing, window will close when complete
2.linux下编辑定时任务 crontab -e
凌晨4点合并索引,其余时间每分钟更新索引
* 0-3 * * * /usr/local/sphinx/bin/indexer --config /usr/local/sphinx/etc/sphinx.conf delta --rotate* 6-23 * * * /usr/local/sphinx/bin/indexer --config /usr/local/sphinx/etc/sphinx.conf delta --rotate0 4 * * * /usr/local/sphinx/bin/indexer --config /usr/local/sphinx/etc/sphinx.conf --merge main delta --rotate