1

这是我的查询:

$query = SphinxQL::create($conn)->select('*')
    ->from('my_index')
    ->match('name', 'bird + monkey', true);
    $result = $query->execute();

在值之间添加+或添加||(给出匹配“鸟”和/或“猴子”的结果)。

我想添加多个运算符,如下所示:

    $query = SphinxQL::create($conn)->select('*')
    ->from('my_index')
    ->match('name', '(bird + monkey) || cat', true);
    $result = $query->execute();

我尝试查看SphinxQL和sphinxsearch 文档的查询构建器,但找不到这样的示例。

4

1 回答 1

1

感谢 barryhunter 找到了答案。正确的语法是:

 $query = SphinxQL::create($conn)->select('*')
->from('my_index')
->match('name', '("bird  monkey") | cat', true);
$result = $query->execute();
于 2016-09-11T08:05:20.110 回答