“ join”和“ bool”一起查询吗? -Elasticsearch

时间:2018-09-20 16:22:56

标签: php elasticsearch

我正在尝试运行一个查询,该查询将基于布尔型必须匹配查询和has_parent查询提取结果。但是,我不知道如何将这两个参数组合在一起。我要合并在一起的两个查询如下:

$params = [
            'body' => [
                'query' => [
                    'match' => [
                        'city' => 'UK'
                    ]
                ]
            ]
        ];

$paramsTwo = [
            'body' => [
                'query' => [
                    'has_child' => [
                        'type' => 'asset',
                        'query' => [
                            'bool' => [
                                'must' => [
                                    'match' => ['asset_type' => 'Hot Desk']
                                ],
                                'should' => [
                                    'match' => ['description' => 'coffee']
                                ]
                            ]
                        ]
                    ] 
                ]
            ]
        ];

我想在venues中找到'UK'(孩子)也assets(应该是'hot desks'的{​​{1}}(父母)-相关。

有帮助吗?

coffee

0 个答案:

没有答案