C++ 搜索引擎xunSearch的配置、安装
如何做出自己的搜索引擎?
站内搜索的php web,基于lucene实现的。而国产开源项目xunSearch则是基于c++的,性能不得不赞!
xunSearch 官网
http://www.xunsearch.com/
linux下的配置如下
[root@iZ94s4ycnl7Z sbin]# cd /usr/local/xunsearch
[root@iZ94s4ycnl7Z xunsearch]# wget http://www.xunsearch.com/download/xunsearch-full-latest.tar.bz2
--2016-11-05 14:40:50-- http://www.xunsearch.com/download/xunsearch-full-latest.tar.bz2
Resolving www.xunsearch.com (www.xunsearch.com)... 202.75.216.236
Connecting to www.xunsearch.com (www.xunsearch.com)|202.75.216.236|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10435852 (10.0M) [application/bzip2]
Saving to: ‘xunsearch-full-latest.tar.bz2’
100%[==============================================>] 10,435,852 2.25MB/s in 4.1s
2016-11-05 14:40:54 (2.42 MB/s) - ‘xunsearch-full-latest.tar.bz2’ saved [10435852/10435852]
[root@iZ94s4ycnl7Z xunsearch]# tar -xjf xunsearch-full-latest.tar.bz2
[root@iZ94s4ycnl7Z xunsearch]# cd xunsearch-full-1.4.10/
[root@iZ94s4ycnl7Z xunsearch-full-1.4.10]# sh setup.sh
+==========================================+
| Welcome to setup xunsearch(full) |
| 欢迎使用 xunsearch (完整版) 安装程序 |
+------------------------------------------+
| Follow the on-screen instructions please |
| 请按照屏幕上的提示操作以完成安装 |
+==========================================+
Please specify the installation directory
请指定安装目录 (默认为中括号内的值)
[/usr/local/xunsearch]:
Confirm the installation directory
请确认安装目录:/usr/local/xunsearch [Y/n]y
Checking scws ... no
Installing scws (1.2.3) ...
Extracting scws package ...
Configuring scws ...
Compiling & installing scws ...
Checking scws dict ... no
Extracting scws dict file ...
Checking libuuid ... no, try to install it
Extracting libuuid package ...
Configuring libuuid ...
Compiling & installing libuuid ...
Checking xapian-core-scws ... no
Installing xapian-core-scws (1.2.22) ...
Extracting xapian-core-scws package ...
Configuring xapian-core-scws ...
Compiling & installing xapian-core-scws ...
^HChecking libevent ... no
Installing libevent (2.0.21-stable) ...
Extracting libevent package ...
Configuring libevent ...
Compiling & installing libevent ...
Extracting xunsearch package (1.4.10) ...
Configuring xunsearch ...
Compiling & installing xunsearch ...
Cleaning ... done
+=================================================+
| Installation completed successfully, Thanks you |
| 安装成功,感谢选择和使用 xunsearch |
+-------------------------------------------------+
| 说明和注意事项: |
| 1. 开启/重新开启 xunsearch 服务程序,命令如下: |
| /usr/local/xunsearch/bin/xs-ctl.sh restart
| 强烈建议将此命令写入服务器开机脚本中 |
| |
| 2. 所有的索引数据将被保存在下面这个目录中: |
| /usr/local/xunsearch/data
| 如需要转移到其它目录,请使用软链接。 |
| |
| 3. 您现在就可以在我们提供的开发包(SDK)基础上 |
| 开发您自己的搜索了。 |
| 目前只支持 PHP 语言,参见下面文档: |
| /usr/local/xunsearch/sdk/php/README
+=================================================+
[root@iZ94s4ycnl7Z xunsearch-full-1.4.10]#
[root@iZ94s4ycnl7Z xunsearch-full-1.4.10]# cd /usr/local/xunsearch/bin
[root@iZ94s4ycnl7Z bin]# xs-ctl.sh start
-bash: xs-ctl.sh: command not found
[root@iZ94s4ycnl7Z bin]# ./xs-ctl.sh start
INFO: starting server[xs-indexd] ... (BIND:127.0.0.1:8383)
INFO: starting server[xs-searchd] ... (BIND:127.0.0.1:8384)
[root@iZ94s4ycnl7Z bin]#
[root@iZ94s4ycnl7Z xunsearch]# wget http://www.xunsearch.com/download/xunsearch-full-latest.tar.bz2
--2016-11-05 14:40:50-- http://www.xunsearch.com/download/xunsearch-full-latest.tar.bz2
Resolving www.xunsearch.com (www.xunsearch.com)... 202.75.216.236
Connecting to www.xunsearch.com (www.xunsearch.com)|202.75.216.236|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10435852 (10.0M) [application/bzip2]
Saving to: ‘xunsearch-full-latest.tar.bz2’
100%[==============================================>] 10,435,852 2.25MB/s in 4.1s
2016-11-05 14:40:54 (2.42 MB/s) - ‘xunsearch-full-latest.tar.bz2’ saved [10435852/10435852]
[root@iZ94s4ycnl7Z xunsearch]# tar -xjf xunsearch-full-latest.tar.bz2
[root@iZ94s4ycnl7Z xunsearch]# cd xunsearch-full-1.4.10/
[root@iZ94s4ycnl7Z xunsearch-full-1.4.10]# sh setup.sh
+==========================================+
| Welcome to setup xunsearch(full) |
| 欢迎使用 xunsearch (完整版) 安装程序 |
+------------------------------------------+
| Follow the on-screen instructions please |
| 请按照屏幕上的提示操作以完成安装 |
+==========================================+
Please specify the installation directory
请指定安装目录 (默认为中括号内的值)
[/usr/local/xunsearch]:
Confirm the installation directory
请确认安装目录:/usr/local/xunsearch [Y/n]y
Checking scws ... no
Installing scws (1.2.3) ...
Extracting scws package ...
Configuring scws ...
Compiling & installing scws ...
Checking scws dict ... no
Extracting scws dict file ...
Checking libuuid ... no, try to install it
Extracting libuuid package ...
Configuring libuuid ...
Compiling & installing libuuid ...
Checking xapian-core-scws ... no
Installing xapian-core-scws (1.2.22) ...
Extracting xapian-core-scws package ...
Configuring xapian-core-scws ...
Compiling & installing xapian-core-scws ...
^HChecking libevent ... no
Installing libevent (2.0.21-stable) ...
Extracting libevent package ...
Configuring libevent ...
Compiling & installing libevent ...
Extracting xunsearch package (1.4.10) ...
Configuring xunsearch ...
Compiling & installing xunsearch ...
Cleaning ... done
+=================================================+
| Installation completed successfully, Thanks you |
| 安装成功,感谢选择和使用 xunsearch |
+-------------------------------------------------+
| 说明和注意事项: |
| 1. 开启/重新开启 xunsearch 服务程序,命令如下: |
| /usr/local/xunsearch/bin/xs-ctl.sh restart
| 强烈建议将此命令写入服务器开机脚本中 |
| |
| 2. 所有的索引数据将被保存在下面这个目录中: |
| /usr/local/xunsearch/data
| 如需要转移到其它目录,请使用软链接。 |
| |
| 3. 您现在就可以在我们提供的开发包(SDK)基础上 |
| 开发您自己的搜索了。 |
| 目前只支持 PHP 语言,参见下面文档: |
| /usr/local/xunsearch/sdk/php/README
+=================================================+
[root@iZ94s4ycnl7Z xunsearch-full-1.4.10]#
[root@iZ94s4ycnl7Z xunsearch-full-1.4.10]# cd /usr/local/xunsearch/bin
[root@iZ94s4ycnl7Z bin]# xs-ctl.sh start
-bash: xs-ctl.sh: command not found
[root@iZ94s4ycnl7Z bin]# ./xs-ctl.sh start
INFO: starting server[xs-indexd] ... (BIND:127.0.0.1:8383)
INFO: starting server[xs-searchd] ... (BIND:127.0.0.1:8384)
[root@iZ94s4ycnl7Z bin]#