sphinx php 配置文件,sphinx+coreseek+php 安装配置过程及其坑

计划上年年头做的事,中间一直没做,还以为要放弃了,想不到周周转转,在今年年头给做了出来。还是有少少开心的。

而下都是我在安装过程中的坑,都记录下来了,希望帮到自己又帮到人啦。安装mmseg

$ cd mmseg

$ ./configure --prefix=/usr/local/mmseg

$ make

$ make install

安装mmseg3时出现config.status: error: cannot find input file: src/Makefile.in

http://vtrtbb.iteye.com/blog/1933050 (根据不同系统,按需安装,我的是m4)

2.安装Coreseek

./buildconf.sh (记得要先运行这个,再初始化)

安装Coreseek ./configure时 是报:checking MySQL include files... configure: error: missing include files.

因为mysql5.5的/usr/local/mysql/lib/mysql是不存在的,所以把--with-mysql-libs这个配置去掉

因为--with-mysql-includes这个配置是需要mysql.h这个文件,而这个文件在mysql的源码里面,所以配置要写成--with-mysql-includes=/root/lnmp1.1-full/mysql-5.5.37/include/ (在实际环境中这个地址要改成其他地方)

不然在make 命令就会报这个错sphinx.h:62:19: error: mysql.h: No such file or directory

./configure --prefix=/usr/local/sphinx --with-mysql=/usr/local/mysql/ --with-mysql-includes=/root/lnmp1.1-full/mysql-5.5.37/include/ --with-mmseg=/usr/local/mmseg/ --with-mmseg-includes=/usr/local/mmseg/include/mmseg --with-mmseg-libs=/usr/local/mmseg/lib/

make && make install

3.php安装sphinx扩展

安装完 make test报错

The test-suite requires that proc_open() is available.

到php.ini 将disable_functions 里面的proc_open这个去掉

4.多表多索引查询

在/usr/local/sphinx/etc/csft_mysql.cnf 那里写多几个source(根据自己要查多少个表,就写多少个source,包括增量索引),注意在index配置里面的source,要写回对应source源,而php代码如下$sphObj->AddQuery($keyword, 'goods_brand,goods_cate');

$res = $sphObj->RunQueries()

参考链接:

coreseek-3.2.14 配置,已经在PHP中实现,还包括了实时更新搜索字段:http://www.cnblogs.com/debuger/archive/2012/07/09/2583206.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值