弹性搜索1.4和Drupal 7:在查询中使用数组

钴铁


在PHP Drupal中,我希望发出一个在字段“ field_xxx”中查找并带有几个标识的请求:id = 106 AND id = 105(如过滤器)。
我尝试了各种解决方案均未成功。
有人可以帮我吗?非常感谢你

$searchParams = [
    'index' => 'indextest,
    'type' => 'index_test',
    'body' => [
        'query' => [
            'bool' => [
                'must' => [
                    [ 'match' => [ 'title' => 'the cat' ] ],
                    [ 'match' => [ 'field_xxx' => ['106','105'] ] ],
                ]
            ]
        ]
    ]
];



$searchParams['body']['query']['match']['title'] = "Le jeu de la dame";
$searchParams['body']['query']['bool']['must']['field_support']= '106,105';
普拉提瓦萨(Pratikvasa)

我认为terms查询将是有用的。

看看这个

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章