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扩展
  1. 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

欢迎关注

微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍

原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/248755

非原创文章文中已经注明原地址,如有侵权,联系删除

关注公众号【高性能架构探索】,第一时间获取最新文章

转载文章受原作者版权保护。转载请注明原作者出处!

(0)
上一篇 2023年2月14日 上午3:11
下一篇 2023年2月14日 上午3:11

相关推荐