最後更新:2016-06-06
來源:互聯網
上載者:User
關鍵字
sphinx
coreseek
php
linux
有這麼幾個問題始終弄不清楚,網上搜尋很多資訊,沒有找到相關答案
1、php操作coreseek為什麼除了安裝sphinx擴充之外,還要安裝libsphinxclient?如果說sphinx擴充依賴於libsphinxclient,依賴它什嗎?
2、擴充+libsphinxclient安裝成功之後$sphinx->Query返回false,即無結果,不管是英文還是中文
而把擴充關掉,用sphinxapi.php則可以正確返回結果
如果用php操作sphinx而不是coreseek,也可以正確返回結果
3、如果用sphinxapi.php操作coreseek,中文情況下,words的下標是亂碼
$keyword="baixue";$sphinx=new SphinxClient();$sphinx->setServer("localhost",9312);$sphinx->setMatchMode(SPH_MATCH_ANY);$result=$sphinx->Query("$keyword","*");echo "";var_dump($result);echo " ";
環境:CentOS7、php5.4、coreseek3.2.14
回複內容:
有這麼幾個問題始終弄不清楚,網上搜尋很多資訊,沒有找到相關答案 1、php操作coreseek為什麼除了安裝sphinx擴充之外,還要安裝libsphinxclient?如果說sphinx擴充依賴於libsphinxclient,依賴它什嗎? 2、擴充+libsphinxclient安裝成功之後$sphinx->Query返回false,即無結果,不管是英文還是中文 而把擴充關掉,用sphinxapi.php則可以正確返回結果 如果用php操作sphinx而不是coreseek,也可以正確返回結果 3、如果用sphinxapi.php操作coreseek,中文情況下,words的下標是亂碼
$keyword="baixue";$sphinx=new SphinxClient();$sphinx->setServer("localhost",9312);$sphinx->setMatchMode(SPH_MATCH_ANY);$result=$sphinx->Query("$keyword","*");echo "";var_dump($result);echo " ";
環境:CentOS7、php5.4、coreseek3.2.14
第一個問題: 就是依賴,也甭管為什麼依賴,如果沒有libsphinxclient,./configure的時候提示Cannot find libsphinxclient headers,根本無法make
第二個問題: 用$sphinx->getLastError()返回報錯資訊 client version is higher than daemon version (client is v.1.29, daemon is v.1.22),即用戶端版本高於守護版(用戶端v.1.29,守護v.1.22) sphinx擴充版本高了,換個低版本$sphinx->Query即可返回資訊
第三個問題: charset_type = sbcs 改為 charset_type = zh_cn.utf-8 charset_dictpath = /usr/local/mmseg3/etc/(mmseg安裝路徑/etc/) 我把zh_cn.utf-8寫成了zh.cn_utf-8,所以一直找不到問題