zoukankan      html  css  js  c++  java
  • sphinx安装步骤

    1、需要mysql-devel包。
    2、如无 gcc / gcc-c++包
    -------------------------------------------------------------
    英文版的sphinx安装
    a、 ./configure --prefix=/usr/local/sphinx --with-mysql=/usr
    b、 make
    c、 make install
    例子:
    cd /usr/local/sphinx
    cd etc
    /usr/local/sphinx/bin/indexer --all
    /usr/local/sphinx/bin/searchd
    停止
    /usr/local/sphinx/bin/searchd -c /usr/local/sphinx/etc/sphinx.conf --stop
    /usr/local/sphinx/bin/searchd -c /usr/local/sphinx/etc/sphinx.conf --stop
    sphinx-for-chinese安装
    --------------------------------------------------------------------------
    1、http://code.google.com/p/sphinx-for-chinese/downloads/list 下载
    sphinx-for-chinese-1.10.1-dev-r2287.tar.gz 
    2、进行安装
      tar xvzf sphinx-for-chinese-1.10.1-dev-r2287.tar.gz 
      cd sphinx_xxx
      ./configure --prefix=/usr/local/sphinx --with-mysql=/usr
      make 
      make install
      这样基本安装就好了。
    3、解压分词
      tar xvzf xdict_1.1.tar.gz 
      cd /usr/local/sphinx
      cd bin
      ./mkdict /path/to/xdict_1.1.txt /usr/local/sphinx/etc/xdict
    4、配置sphinx文档
       cd /usr/local/sphinx/etc
       cp sphinx.config.dist sphinx.config
       
       vi sphinx.config
       找到charset_type = utf-8
       后添加
       chinese_dictionary = /usr/local/sphinx/etc/xdict
    5、建议简单indexer
       cd /usr/local/sphinx/etc/
       /usr/local/sphinx/bin/indexer --all
       /usr/local/sphinx/bin/searchd
       如要关闭
       /usr/local/sphinx/bin/searchd -c /usr/local/sphinx/etc/sphinx.conf --stop
    这样一个简单的例子就OK了
    WINDOW版下的安装
    ------------------------------------------------------------------------------------------------------------------------------
    1、到官网上下载http://www.sphinxsearch.com/downloads.html 下载win32 binaries w/mysql suppot的sphinx 
    0.9.9版
    2、解压到window下某目录下 例如:d:\sphinx
       把例子example.sql 建在mysql中。
    3、安装.
    d: cd sphinx
    cd bin
    searchd.exe --install --config d:\sphinx\sphinx.conf --servicename sphinxSearch
    安装成功
    4、配置sphinx.conf文件
    主要有四项,source documents(源头)、index documents(源头)、indexer、searchd服务选项配置
    5、建立索引
    cd bin
    indexer.exe --config d:\sphinx\sphinx.conf documents(源头)
    6、运行sphinx进程
    searchd.exe --config d:\sphinx\sphinx.conf
    7、命令测试效果 
    search.exe -c d:\sphinx\sphinx.conf this is my
  • 相关阅读:
    Python学习杂记_2_格式化字符串的一些操作
    Python学习杂记_1_PyCharm使用的一些收获
    autolayout sizeclass 资料集锦
    据说这个是获得当前的控制器方法,没试过
    Mac下搭建php开发环境【转】
    搜索栏会消失 uisearchbar 狂点消失的问题解决
    mac下XAMPP服务器配置多站点配置局域网配置 (转)
    在 Xcode 6 中使用矢量图( iPhone 6 置配 UI)
    收到远程通知,怎么区分是点击通知栏提醒进去的还是在foreground收到的通知?
    开发经验之状态机思想,分别使用了swift,OC,C,PHP语言实现
  • 原文地址:https://www.cnblogs.com/myphoebe/p/2144929.html
Copyright © 2011-2022 走看看