linux下全文检索引擎sphinx/coreseek的安装配置

  • Jesse
  • 2018-06-27 19:38:18
  • 679

linux下全文检索引擎sphinx/coreseek的安装配置

1.安装预装软件

yum install make gcc g++ gcc-c++ libtool autoconf automake imake mysql-devel libxml2-devel expat-devel

 

2.下载coreseek4.1

https://download.csdn.net/download/dl425134845/9535621

 

3.解压

tar zxvf coreseek-4.1-beta.tar.gz

 

4.安装

进入到mmseg-3.2.14目录,在该目录中运行./bootstrap 命令。

 

5.指定安装coreseek安装路径

./configure --prefix=/usr/local/mmseg3

 

6.实际安装coreseek

make && make install

 

7.测试coreseek的分词效果

进入到/usr/local/mmseg3/bin 目录中,执行如下命令

./mmseg -d /usr/local/mmseg3/etc /usr/local/src/coreseek-4.1-beta/mmseg-3.2.14/src/t1.txt

 

8.安装coreseek

回到coreseek-4.1-beta目录,进入csft-3.2.14里,执行编译配置,命令如下:

        csft-4.1/buildconf.sh

        查找

        && aclocal

        后加上

        && automake –add-missing

 

        csft-4.1/configure.ac

        查找

        AM_INIT_AUTOMAKE([-Wall -Werror foreign])

        改为

        AM_INIT_AUTOMAKE([-Wall foreign])

 

        查找

        AC_PROG_RANLIB

        后面加上

        AM_PROG_AR

 

        csft-4.1/src/sphinxexpr.cpp

        替换所有

        T val = ExprEval ( this->m_pArg, tMatch );

       

        T val = this->ExprEval ( this->m_pArg, tMatch );

sh buildconf.sh

./configure --prefix=/usr/local/coreseek  --without-unixodbc --with-mmseg --with-mmseg-includes=/usr/local/mmseg3/include/mmseg/ --with-mmseg-libs=/usr/local/mmseg3/lib/ --with-mysql

make && make install

 

9.测试coreseek

进入testpack目录

cd ../testpack

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

 

10.配置coreseek支持mysql数据源

配置csft_mysql.conf文件,复制mysql配置文件到coreseek安装目录etc/

cp /usr/local/src/coreseek-3.2.14/testpack/etc/csft_mysql.conf /usr/local/coreseek/etc/

cd /usr/local/coreseek/etc/

    SELECT goods_id, cat_id1, on_time, goods_name, goods_remark FROM tp_goods

 

11.建立索引,执行如下命令

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

 

12.启动searchd后台服务模式

/usr/local/coreseek/bin/searchd -c /usr/local/coreseek/etc/csft_mysql.conf

/usr/local/coreseek/bin/searchd -c /usr/local/coreseek/etc/csft_mysql.conf --stop 停止服务

 

13.测试服务

/usr/local/coreseek/bin/search -c /usr/local/coreseek/etc/csft_mysql.conf apple

 

14.配置sphinx

application/config.php

本文出自 showcj,转载时请注明出处及相应链接。