迅搜全文检索安装教程【完整版】--迅搜官方提供的安装教程并不完整
admin | 2017-05-24 21:52 阅 930 评 0
从迅搜更新了最近的一个版本之后,发现安装会出现各种问题。 
之前安装的时候非常顺利。 
现在把我在centos 6.8 最小化安装的上面安装最新版本的迅搜出现的问题记录一下,也便于各位处理、安装。 
安装步骤: 


wget http://www.xunsearch.com/download/xunsearch-full-latest.tar.bz2 
tar -xjf xunsearch-full-latest.tar.bz2 
cd xunsearch-full-1.4.10/ 
sh setup.sh 


安装过程可以选择路径,也可以默认路径,然后Y。 
执行完上面的步骤,有两个结果,正常的结果如下图,表示已经安装成功了。 
 
安装过程中的问题 
问题1: 

configure: error: in `/opt/xunsearch-full-1.4.10/scws-1.2.3': 
configure: error: no acceptable C compiler found in $PATH 
解决方法: 
yum install gcc 


问题2: 
configure: error: 
*** You need a working C++ compiler to compile Xapian, but configure failed to 
*** find one. If you have a working C++ compiler, you can tell configure where 
*** to find it by invoking it like so: 
*** 
*** ./configure CXX=/opt/bin/c++ 
解决方法: 

yum install glibc-headers gcc-c++ 


问题3: 
configure: error: in `/opt/xunsearch-full-1.4.10/xapian-core-scws-1.2.22': 
configure: error: C++ preprocessor "/lib/cpp" fails sanity check 
解决方法: 
yum install glibc-headers gcc-c++ 


问题4: 
checking for zlib.h... no 
configure: error: zlib.h not found - required for brass, chert and flint (you may need to install the zlib1g-dev or zlib-devel package) 
解决方法: 

yum search zlib #跟我环境一样的可以略过,就是为了查查哪个是我要安装的 
yum install zlib-devel 


使用: 
进入到/usr/local/xunsearch/bin
 
cd /usr/local/xunsearch/bin./xs-ctl.sh restart 

可以看到默认的绑定端口已经运行了,xunsearch默认运行的是8383和8384 
WARNING: no server[xs-indexd] is running (BIND:127.0.0.1:8383) 
INFO: re-starting server[xs-indexd] ... (BIND:127.0.0.1:8383) 
WARNING: no server[xs-searchd] is running (BIND:127.0.0.1:8384) 
INFO: re-starting server[xs-searchd] ... (BIND:127.0.0.1:8384) 




以上均是经过测试成功的! 


如果你遇到什么问题可以与我们进行交流! 



1.使用mysql插入数据: 
/opt/xunsearch/sdk/php/util/Indexer.php --rebuild --source=mysql://root:@localhost/mysql --sql="select link_id,title,fulltxt,description,keywords,updatetime from find_links" --project=findworlds 


上面是一整行来的 


2. 经典用法示例,生成PHP文件搜索模板 
# 在当前目录下生成 demo 项目的搜索代码 
util/SearchSkel.php demo 

# 在指定的 /path/to/web 目录生成 demo 搜索代码,代码目录为:/path/to/web/demo 
util/SearchSkel.php demo /path/to/web 

# 使用选项指定方式 
util/SearchSkel.php -p demo -o /path/to/web
说说我的看法
最新评论
    快来抢沙发...