溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

sphinx+coreseek+php 安裝配置過(guò)程及其坑

發(fā)布時(shí)間:2020-07-29 20:56:20 來(lái)源:網(wǎng)絡(luò) 閱讀:609 作者:gzcxl123 欄目:web開(kāi)發(fā)

計(jì)劃上年年頭做的事,中間一直沒(méi)做,還以為要放棄了,想不到周周轉(zhuǎn)轉(zhuǎn),在今年年頭給做了出來(lái)。還是有少少開(kāi)心的。

而下都是我在安裝過(guò)程中的坑,都記錄下來(lái)了,希望幫到自己又幫到人啦。

  1. 安裝mmseg


$ cd mmseg


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


$ make


$ make install


安裝mmseg3時(shí)出現(xiàn)config.status: error: cannot find input file: src/Makefile.in


http://vtrtbb.iteye.com/blog/1933050 (根據(jù)不同系統(tǒng),按需安裝,我的是m4)


2.安裝Coreseek


 ./buildconf.sh (記得要先運(yùn)行這個(gè),再初始化)


安裝Coreseek ./configure時(shí) 是報(bào):checking MySQL include files... configure: error: missing include files.

因?yàn)閙ysql5.5的/usr/local/mysql/lib/mysql是不存在的,所以把--with-mysql-libs這個(gè)配置去掉


因?yàn)?-with-mysql-includes這個(gè)配置是需要mysql.h這個(gè)文件,而這個(gè)文件在mysql的源碼里面,所以配置要寫(xiě)成--with-mysql-includes=/root/lnmp1.1-full/mysql-5.5.37/include/ (在實(shí)際環(huán)境中這個(gè)地址要改成其他地方)


不然在make 命令就會(huì)報(bào)這個(gè)錯(cuò)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擴(kuò)展 

安裝完 make test報(bào)錯(cuò)

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

到php.ini 將disable_functions 里面的proc_open這個(gè)去掉


4.多表多索引查詢

在/usr/local/sphinx/etc/csft_mysql.cnf 那里寫(xiě)多幾個(gè)source(根據(jù)自己要查多少個(gè)表,就寫(xiě)多少個(gè)source,包括增量索引),注意在index配置里面的source,要寫(xiě)回對(duì)應(yīng)source源,而php代碼如下

$sphObj->AddQuery($keyword, 'goods_brand,goods_cate');
$res = $sphObj->RunQueries()


參考鏈接:

詳細(xì)安裝配置:http://blog.csdn.net/e421083458/article/details/21529969#t3

按錯(cuò)錯(cuò)誤解決辦法:http://vtrtbb.iteye.com/blog/1933050

配置coreseek支持mysql數(shù)據(jù)源:http://www.phperz.com/article/14/0615/95.html

coreseek-3.2.14 配置,已經(jīng)在PHP中實(shí)現(xiàn),還包括了實(shí)時(shí)更新搜索字段:http://www.cnblogs.com/debuger/archive/2012/07/09/2583206.html


向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI