Sphinx 安装与使用(1)-- 安装Coreseek

Coreseek就是Sphinx的中文版

官方网站

http://www.coreseek.cn/

 

一、安装

1.修改LANG

永久修改:
vim /etc/locale.conf
LANG="zh_CN.UTF-8" 

临时修改
export LANG="zh_CN.UTF-8"
export LC_ALL="zh_CN.UTF-8"

 2.安装依赖包

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

3.下载coreseek4.1并解压(如果网址不行请到官方网站http://www.coreseek.cn/搜索下载地址)

cd ~

wget http://www.coreseek.cn/uploads/csft/4.0/coreseek-4.1-beta.tar.gz

tar zxvf coreseek-4.1-beta.tar.gz

cd coreseek-4.1-beta

 

 4.安装mmseg3

cd mmseg-3.2.14

./bootstrap

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

make && make install
警告不用理会

 5.安装csft

cd csft-4.1

sh buildconf.sh

可能报错:
automake: warnings are treated as errors

此时,修改configure.ac
vim configure.ac
13行 >>>
AM_INIT_AUTOMAKE([-Wall -Werror foreign]) 改为
AM_INIT_AUTOMAKE([-Wall foreign]) subdir-objects
保存退出

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

make && make install

make时,可能出现的错误:
sphinxexpr.cpp:1823:43: error: ‘ExprEval’ was not declared in this scope, and no declarations were found by …………

vim src/sphinxexpr.cpp
修改报错行(1823)的 ExprEval改为 this->ExprEval

第1777,1746可能出现相同的问题,解决方法一样。
直达行号:
1777修改后,再次:
make
&& make install

6.安装libsphinxclient

cd csft-4.1/api/libsphinxclient

sh buildconf.sh

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

make && make install

 7.安装sphinx php扩展

下载pecl扩展:
cd ~
wget http://pecl.php.net/get/sphinx-1.3.3.tgz

安装:
tar -zxvf sphinx-1.3.3.tgz 

cd sphinx-1.3.3

phpize

./configure --with-php-config=/usr/bin/php-config --with-sphinx=/usr/local/sphinxclient

make && make install

安装后,在/usr/lib64/php/modules/目录下生成sphinx.so扩展

8. php导入spinx扩展

在/etc/php.d/目录下新建20-sphinx.ini,写入以下内容:
cd /etc/php.d/
vim 20-sphinx.ini
extension=sphinx.so
保存并退出,重启apache

 

转载于:https://www.cnblogs.com/shifu204/p/6367727.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值