zoukankan      html  css  js  c++  java
  • xunsearch安装使用

    安装步骤

    1.下载

    wget http://www.xunsearch.com/download/xunsearch-full-latest.tar.bz2
    tar -xjf xunsearch-full-latest.tar.bz2
    

    2.进入,安装

     cd xunsearch-full-1.4.11/
    sh setup.sh
    
    +=================================================+
    | Installation completed successfully, Thanks you |
    | 安装成功,感谢选择和使用 xunsearch              |
    +-------------------------------------------------+
    | 说明和注意事项:                                |
    | 1. 开启/重新开启 xunsearch 服务程序,命令如下: |
    |    /home/jiqing/xunsearch/bin/xs-ctl.sh restart
    |    强烈建议将此命令写入服务器开机脚本中         |
    |                                                 |
    | 2. 所有的索引数据将被保存在下面这个目录中:     |
    |    /home/jiqing/xunsearch/data
    |    如需要转移到其它目录,请使用软链接。         |
    |                                                 |
    | 3. 您现在就可以在我们提供的开发包(SDK)基础上    |
    |    开发您自己的搜索了。                         |
    |    目前只支持 PHP 语言,参见下面文档:          |
    |    /home/jiqing/xunsearch/sdk/php/README
    +=================================================+
    
    

    3.安装成功后,启动后台服务

    sudo sh /home/jiqing/xunsearch/bin/xs-ctl.sh restart
    
    
    $ sudo sh /home/jiqing/xunsearch/bin/xs-ctl.sh restart
    INFO: stopping server[xs-indexd] (BIND:127.0.0.1:8383) .... [OK]
    INFO: re-starting server[xs-indexd] ... (BIND:127.0.0.1:8383)
    INFO: stopping server[xs-searchd] (BIND:127.0.0.1:8384) .... [OK]
    INFO: re-starting server[xs-searchd] ... (BIND:127.0.0.1:8384)
    
    

    可以查看服务启动情况

    $ ps -ef |grep xs
    root     14050  3097  0 09:59         00:00:00 xs-indexd: server
    root     14055  3097  0 09:59        00:00:00 xs-searchd: master
    root     14056 14055  0 09:59        00:00:00 xs-searchd: worker[1]
    root     14057 14055  0 09:59        00:00:00 xs-searchd: worker[2]
    root     14058 14055  0 09:59        00:00:00 xs-searchd: worker[3]
    ...
    
    $ sudo netstat -anp | grep xs
    tcp        0      0 127.0.0.1:8383          0.0.0.0:*               LISTEN      14050/xs-indexd: se
    tcp        0      0 127.0.0.1:8384          0.0.0.0:*               LISTEN      14055/xs-searchd: m
    ...
    

    可以将此命令添加到开机启动脚本中/etc/rc.local

    #!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.
    sudo sh /home/jiqing/xunsearch/bin/xs-ctl.sh restart
    

    4.安装PHP-SDK

    只需要引入SDK即可。

    require_once '$prefix/sdk/php/lib/XS.php';
    

    检查环境情况

    $php RequiredCheck.php 
    Xunsearch PHP-SDK 运行需求检查
    ==============================
    
    检查内容
    --------
    
    本程序用于确认您的服务器配置是否能满足运行 Xunsearch PHP-SDK 的要求。
    它将检查服务器所运行的 PHP 版本,查看是否安装了合适的PHP扩展模块,以及
    确认 php.ini 文件是否正确设置。
    
    +------------+------------+--------------------------+--------------------------------+
    | 项目       | 结果       | 用于                     | 备注                           |
    +------------+------------+--------------------------+--------------------------------+
    | PHP 版本   | 5.6.31     | XS(core)                 | PHP 5.2.0 或更高版本是必须的。 |
    | SPL 扩展   | OK         | XS(core)                 | SPL 扩展用于自动加载和对象戏法 |
    | PCRE 扩展  | OK         | XSDocument, XSSearch     | 用于字符串切割、判断           |
    | 编码转换   | mbstring   | XSDocument, XSSearch     | 用于支持非 UTF-8 字符集        |
    | 缓存模块   | WARNING    | XS                       | 用于缓存项目配置文件的解析结果 |
    | JSON 扩展  | OK         | util.Quest, util.Indexer | 用于读取或输出 JSON 格式的数据 |
    | XML 扩展   | OK         | util.Indexer             | 用于读取导入 XML 格式的数据    |
    | MySQL 扩展 | mysql      | util.Indexer             | 用于读取导入 MySQL 的数据库    |
    | SQLite 扩  | sqlite3    | util.Indexer             | 用于读取导入 SQLite 的数据库   |
    +------------+------------+--------------------------+--------------------------------+
    
    检查结果
    --------
    
    共计 8 项通过,1 项警告,0 项错误。
    
    您的服务器配置符合 Xunsearch/PHP-SDK 的最低要求。
    如果您需要使用特定的功能,请关注上述的 WARNING 项。 
    
  • 相关阅读:
    12:00的死亡游戏
    数字图像的5种增强处理
    评分系统
    学生信息的检索
    读心球游戏
    图像的中值滤波处理
    山西省高考成绩的排次系统【可查询成绩改正和将作弊成绩去除】
    打印总分与各科成绩单
    各城市地形图的分幅与编号查询系统
    在Visual Studio中利用NTVS创建Pomelo项目
  • 原文地址:https://www.cnblogs.com/jiqing9006/p/9252980.html
Copyright © 2011-2022 走看看