1、下载解压讯讯搜
wget http://www.xunsearch.com/download/xunsearch-full-latest.tar.bz2 tar -xjf xunsearch-full-latest.tar.bz2
2、查看和进入讯搜目录
ls cd xunsearch-full-1.4.14/
3、安装讯搜
sh setup.sh
可以指定安装目录比如/www/wwwroot/xunsearch
4、其它设置
启动命令:
/www/wwwroot/xunsearch/bin/xs-ctl.sh restart
/www/wwwroot/xunsearch/bin/xs-ctl.sh start
加入开机启动:
进入/etc/rc.local,添加启动命令即可。
5、新建配置文件ini
路径:/www/wwwroot/xunsearch/sdk/php/app
代码如下:
project.name = ceshiceshi
project.default_charset = utf-8
server.index = 8383
server.search = 8384
[id]
type = id
[title]
type = title
6、终端执行,开始索引数据。
重建缓存
/www/wwwroot/xunsearch/sdk/php/util/Indexer.php --rebuild --source=mysql://数据库帐号:数据库密码@localhost/数据库名称--sql="SELECT * FROM v9_news" --project=ceshiceshi
清空缓存
/www/wwwroot/xunsearch/sdk/php/util/Indexer.php --clean --project=ceshiceshi