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


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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

友情链接更多精彩内容