【发布时间】:2019-05-05 21:20:03
【问题描述】:
我使用 ES 7 和 Laravel 实现,我想结合范围和术语匹配,根据文档,我这样做了:
$items = $client->search([
'index' => $instance->getSearchIndex(),
'type' => $instance->getSearchType(),
'body' => [
'size' => 50,
'query' => [
'bool' => [
'must' => [
'multi_match' => [
'fields' => config('elasticsearch.fields'),
'query' => $query,
],
],
'filter' => [
'bool' => [
'must' => [
'range' => [
'note' => [
'gte' => config('elasticsearch.note_minimum')
]
],
'term' => [
'type_video_id' => 5
],
],
],
],
]
],
],
]);
得到了这个错误:
"parsing_exception","reason":"[range] 格式错误的查询,预期 [END_OBJECT] 但找到了 [FIELD_NAME]
我只找到了 ES 2 关于组合查询的文档和示例,有什么变化吗?
我希望我的查询匹配字段,并根据过滤器进行过滤。
【问题讨论】:
标签: elasticsearch