ES 版本 2.3,我正在尝试使用过滤器和查询在弹性搜索服务器上运行搜索。我有几个要搜索的键,有些必须是结果的一部分,并且“主机”键应该在结果中(因为我想要来自多个主机的结果,而不仅仅是一个)
这是我正在尝试运行的查询,由于某种原因,我收到一条错误消息 - “search_phase_execution_exception - 没有为 [must] 注册查询”
{
"query": {
"filtered": {
"filter": {
"bool": {
"must": [{
"range": {
"@timestamp": {
"gte": 1503751766908,
"lte": 1503751786908,
"format": "epoch_millis"
}
},
"query": {
"should": [{
"match_phrase": {
"host": "host1"
}
},
{"match_phrase": {
"host": "host2"
}
}],
"must": [{
"match_phrase": {
"key1": "value1"
}
}]
}
}]
}
}
}
}
}