经过大量的尝试和研究,我已成功索引sphinx搜索,使用putty安装了foolz包和作曲家,但当我尝试在我的php文件中搜索时,它给我错误“Warning: mysqli::real_connect(): (HY000/2002): Connection refused in /var/www/html/vendor/foolz/sphinxql-query-builder/src/Connection.php on line 176
”下面是我用于搜索的代码。
require "vendor/autoload.php";
use Foolz\SphinxQL\SphinxQL;
use Foolz\SphinxQL\Connection;
$conn = new Connection();
$conn->setParams(array('host' => '127.0.0.1', 'port' => 3312));
$query = SphinxQL::create($conn)->select('column_one', 'colume_two')
->from('index_ancient', 'index_main', 'index_delta')
->match('comment', 'my opinion is superior to yours')
->where('banned', '=', 1);
$result = $query->execute();
我无法找到下一步。这是我目前所指的链接http://sphinxsearch.com/blog/2014/10/20/sphinxql-query-builder-for-php/
。
请帮忙
答案 0 :(得分:1)
我认为你应该像这个问题一样修复sphinx.conf:Sphinx Search mysql client on production server
通过mysql客户端添加监听:
listen = 9306:mysql41