开始之前强烈推荐先浏览一下 xunsearch 的官方文档
Xunsearch简介
Xunsearch 是一个高性能、全功能的全文检索解决方案。
Xunsearch 旨在帮助一般开发者针对既有的海量数据,快速而方便地建立自己的全文搜索引擎。
详情点我
测试环境:
Linux 服务器 2 台:
代号 | 功能 | IP | 系统 |
---|---|---|---|
服务器A | 提供web服务 | 192.168.56.2 | centos7 |
服务器B | 提供 xunsearch 后端服务 | 192.168.56.3 | centos7 |
xunsearch 后端服务器配置:
PHP版本 7.0.13 没有安装缓存, 生产环境推荐安装缓存
PHP 7.0.13 (cli) (built: Dec 21 2016 13:53:31) ( NTS )Copyright (c) 1997-2016 The PHP GroupZend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Xdebug v2.5.0, Copyright (c) 2002-2016, by Derick Rethans
连接到服务器B 运行下面指令安装, 解压 xunsearch 安装包
wget http://www.gaodaima.com/tar -xjf xunsearch-full-latest.tar.bz2
执行安装脚本,根据提示进行操作,主要是输入 xunsearch 软件包的安装目录,强烈建议单独 规划一个目录,而不是混到别的软件目录中。
cd 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]YChecking scws ... noInstalling scws (1.2.3) ... Extracting scws package ...Configuring scws ...Compiling & installing scws ...Checking scws dict ... noExtracting scws dict file ... Checking libuuid ... no, try to install itExtracting libuuid package ...Configuring libuuid ...Compiling & installing libuuid ...Checking xapian-core-scws ... noInstalling xapian-core-scws (1.2.22) ... Extracting xapian-core-scws package ...Configuring xapian-core-scws ...Compiling & installing xapian-core-scws ...Checking libevent ... noInstalling 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 |+-------------------------------------------------+| 说明和注意事项: <em style="color:transparent">本文来源[email protected]搞@^&代*@码)网9</em><strong>搞代gaodaima码</strong> || 1. 开启/重新开启 xunsearch 服务程序,命令如下: || /usr/local/xunsearch/bin/xs-ctl.sh restart || 强烈建议将此命令写入服务器开机脚本中 || || 2. 所有的索引数据将被保存在下面这个目录中: || /usr/local/xunsearch/data || 如需要转移到其它目录,请使用软链接。 || || 3. 您现在就可以在我们提供的开发包(SDK)基础上 || 开发您自己的搜索了。 || 目前只支持 PHP 语言,参见下面文档: || /usr/local/xunsearch/sdk/php/README |+=================================================+