whatsns全文检索xunsearch-问题模块配置

  1. 安装xunserch

下载和安装(安装需要gcc gcc-c++ make支持,记得事先安装)

wget http://www.xunsearch.com/download/xunsearch-full-latest.tar.bz2
tar -xjf xunsearch-full-latest.tar.bz2
cd xunsearch-full-1.4.8/
sh setup.sh
1.1 安装的默认路劲 /usr/local/xunsearch/ ,如果你不是很精通就不要改了,方便照着我下面的操作来做。
1.2 正常情况下5分钟后安装完成,如果失败请看提示编译到哪里出错了,对应出错的所需库,进行安装。

如果发现有警告或者错误,对于响应的模块进行安装,如apc模块。(centos 安装命令就是 yum install php-pecl-apc)

以下是question.ini文件,放入到/usr/local/xunsearch/sdk/php/app/ 下

project.name = questionproject.default_charset = utf-8server.index = 8383server.search = 8384[id]type = id[cid]type = numeric[cid1]type = numeric[cid2]type = numeric[cid3]type = numeric[author][authorid]type = numeric[answers]type = numeric[status]type = numeric[time]type = numeric[title]type = title[description]type = body

上面都ok了,重启一下服务,并把服务放入到开机启动项

/usr/local/xunsearch/bin/xs-ctl.sh restart

安装conv

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
tar -zxvf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure --prefix=/usr/local/iconv
make && make install

让php支持conv

在php.ini中加入一行 extension=/usr/local/iconv/lib/libiconv.so

重启http服务

service httpd restart

在问答系统后台开始全文搜索功能

数据库 my.cnf 加入 ft_min_word_len=1

PHP-SDK文件全路径 /usr/local/xunsearch/sdk/php/lib/XS.php

whatsns全文检索xunsearch-问题模块配置_第1张图片

本文来自: https://www.ask2.cn/article-14732.html

你可能感兴趣的:(whatsns全文检索xunsearch-问题模块配置)