centos 下 sphinx(coreseek)安装及常见问题

centos 下 sphinx(coreseek)安装及常见问题

前期准备:
libtool-2.4.2.tar.gz 、 autoconf-2.64.tar.bz2 、 automake-1.11.2.tar.gz 、 coreseek-3.2.14.tar.gz

sphinx工具包下载地址

开始安装

  • 安装运行所需编译环境(-y是安装的时候不需确认)
    yum -y install glibc make gcc g++ gcc-c++ libtool autoconf automake imake mysql-devel libxml2-devel expat-devel

  • 清除以前的autoconf
    yum erase autoconf

  • 安装libtool
    tar zxvf libtool-2.4.2.tar.gz
    ./configure
    make
    make install

  • 安装autoconf
    tar jxvf autoconf-2.64.tar.bz2
    cd autoconf-2.64
    ./configure
    make
    make install

  • 安装automake
    tar xzvf automake-1.11.tar.gz
    cd automake-1.11
    ./configure
    make
    make install

  • 安装mmseg、csft (这两个软件在coreseek文件里)
    tar zxvf coreseek-3.2.14.tar.gz
    cd coreseek-3.2.14

    先安装mmseg (安装过程不出现error就算成功)
    cd mmseg-3.2.14
    ./bootstrap
    ./configure –prefix=/usr/local/mmseg
    make && make install

    安装coreseek
    cd csft-3.2.14
    sh buildconf.sh
    ./configure –prefix=/usr/local/coreseek –without-unixodbc –with-mmseg –with-mmseg-includes=/usr/local/mmseg/include/mmseg/ –with-mmseg-libs=/usr/local/mmseg/lib/ –with-mysql
    make && make install

    可能出现的问题
    sphinxexpr.cpp:1047:43: error: ‘ExprEval’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]

    出现这个提示只需要找到csft-3.2.14/src/sphinxexpr.cpp 的 1047行,将ExprEval修改为this->ExprEval之后重新执行 make && make install 即可

  • 测试mmseg分词和coreseek搜索
    备注:需要预先设置好字符集为zh_CN.UTF-8,确保正确显示中文。
    运行locale保证如下设置
    LANG=zh_CN.UTF-8
    LC_ALL=”zh_CN.UTF-8”

    配置测试
    /usr/local/coreseek/bin/indexer -c /usr/local/coreseek/etc/sphinx-min.conf.dist
    如图表示成功
    cd testpack
    cat var/test/test.xml #窗口应该正确显示中文,如果出现乱码,请设置好字符集
    /usr/local/mmseg/bin/mmseg -d /usr/local/mmseg/etc var/test/test.xml

    /usr/local/coreseek/bin/indexer -c etc/csft.conf –all

    如果出现文件不存在
    使用命令 find / -name csft.conf 找到文件位置,并将 etc/csft.conf 替换成查询到的位置

    如果出现Unigram dictionary load Error
    编辑 csft.conf 文件,搜索 charset_dictpath ,修改为charset_dictpath = /usr/local/mmseg/etc/

    /usr/local/coreseek/bin/search -c etc/csft.conf 自由缩放
    如图所示即成功
    出现如上图所示结果则表示成功

  • 参考文档

    Sphinx中文指南
    http://www.sphinxsearch.org/sphinx-tutorial

    Sphinx中文分词应用
    http://www.sphinxsearch.org/archives/82

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值