全文检索如何安装

2017-03-09 19:53发布

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 = question
project.default_charset = utf-8
server.index = 8383
server.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


付费偷看设置
发送
2条回答
mishen - whatsns产品经理
1楼 · 2017-03-09 20:26.采纳回答

请前往官网帮助页面参考配置教程:

https://www.whatsns.com/help/index.html

image.png

---------------以上是最新编辑,下面的可以不用看了

blob.png


data和sdk目录记得777,勾选应用到子目录

blob.png


不然没有权限读写,这个是个坑,一般很多人都死在这,要设置好读写权限才在系统后台配置全文检索。

这个写的不清楚不楚的,神仙能看懂啊。。。

楼主能写的详细点嘛?

一周热门 更多>