Kohana 3 - SphinxQL 配置
我在我的服务器上启动并运行了 Sphinx,并且创建了数据索引。我已将 SphinxQL 安装到我的模块文件夹中,并在我的引导程序中启用它。还有什么是我需要做或要做的吗?我还将 sphinxql.php 配置文件的副本移至 kohana/application/config 目录中,但那里可能没有正确的设置。
非常感谢任何试图提供帮助的人!
return array(
'default' => array(
'servers' => array(
'home' => 'localhost:9312',
// Key => Value
//'<server a name>' => '<host>:<port>',
//'<server b name>' => '<host>:<port>',
// For example
//'sphinx_01' => '192.168.1.1:9301',
//'sphinx_02' => '192.168.1.2:9301',
//'sphinx_03' => '192.168.1.3:9301',
// ...or...
//'sphinx_first' => '192.168.1.1:1234',
//'sphinx_second' => '123.45.67.89:8765',
// ...or!
//'my_only_server' => '127.0.0.1:2222',
),
),
);
这是我正在运行的查询,试图返回其中包含术语“searchterm”的文档的 ID。
$sphinxql = new SphinxQL();
$query = $sphinxql->new_query();
$query->add_index('indexname')->search('searchterm');
$result = $query->execute();
I have Sphinx up and running on my server and I have created an index of my data. I have installed SphinxQL into my modules folder and enabled it in my bootstrap. Is there something else that I need to have done or to do to? I have also moved a copy of the sphinxql.php config file into the kohana/application/config directory but I may not have the correct settings there.
Thank you very much to anyone trying to help!
return array(
'default' => array(
'servers' => array(
'home' => 'localhost:9312',
// Key => Value
//'<server a name>' => '<host>:<port>',
//'<server b name>' => '<host>:<port>',
// For example
//'sphinx_01' => '192.168.1.1:9301',
//'sphinx_02' => '192.168.1.2:9301',
//'sphinx_03' => '192.168.1.3:9301',
// ...or...
//'sphinx_first' => '192.168.1.1:1234',
//'sphinx_second' => '123.45.67.89:8765',
// ...or!
//'my_only_server' => '127.0.0.1:2222',
),
),
);
Here is my query I am running to try to return the ids of the documents with the term 'searchterm' within.
$sphinxql = new SphinxQL();
$query = $sphinxql->new_query();
$query->add_index('indexname')->search('searchterm');
$result = $query->execute();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 Kohana_Database_MySQL 来构建 SphinxQL 包装器,并进行一些小的更改。
You can use Kohana_Database_MySQL to build your SphinxQL wrapper with some small changes.