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
/home/www/xunsearch
启动命令:(根据自己的具体路径)
/www/wwwroot/xunsearch/bin/xs-ctl.sh restart
/www/wwwroot/xunsearch/bin/xs-ctl.sh start
4、加入开机启动:
进入/etc/rc.local,添加启动命令即可。
5、新建配置文件ini
路径:/www/wwwroot/xunsearch/sdk/php/app
代码如下:
project.name = discuz
project.default_charset = GBK
;服务端用默认值
;server.index = 8383
;server.search = 8384
[pid]
type = id
[fid]
index = self
tokenizer = full
[tid]
[first]
index = self
tokenizer = full
[author]
index = both
[authorid]
[subject]
type = title
[message]
type = body
[dateline]
type = numeric
pid 主键,必须的
fid 按版块检索时需要用到
tid 搜索结果阅读链接都是按 tid 来的,必备
first 表示该贴子是否为楼主,过滤回贴时用到
author, authorid 按作者检索用得到
subject 标题
message 贴子内容
dateline 发表时间,要用到
6、终端执行,开始索引数据。
/www/wwwroot/xunsearch/sdk/php/util/Indexer.php --rebuild --source=mysql://zhanghao:mima@localhost/shujukumingzi --sql="SELECT * FROM news" --project=peizhiwenjian