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
  • 相关阅读:
    Vue核心之数据劫持
    Flex 布局教程
    Grid布局
    我们都在深夜,参差不齐地入眠
    一个十分好用的动画工具:Velocity.js
    前端知识点总结——jQuery(下)
    前端知识点总结——jQuery(上)
    虫师Selenium2+Python_2、测试环境搭建
    虫师Selenium2+Python_11、自动化测试项目实战
    虫师Selenium2+Python_12、BDD框架之Lettuce入门
  • 原文地址:https://www.cnblogs.com/myphoebe/p/2144929.html
Copyright © 2011-2022 走看看