简体   繁体   English

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

[英]Elastic search 1.4 and Drupal 7 : use array in query


in PHP Drupal, I wish to make a request which looks in the field 'field_xxx' with several identifying: id=106 AND id=105 (like a filter). 在PHP Drupal中,我希望提出一个请求,它在字段'field_xxx'中查找了几个标识:id = 106 AND id = 105(像过滤器一样)。
I tried diverse solutions unsuccessfully. 我试过各种各样的解决方案失败了。
Could anybody help me? 有人能帮助我吗? Thank you very much 非常感谢你

$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';

I think the terms query will be useful. 我认为terms查询会很有用。

Have a look at this 看看这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM