我设法建立查询
- 匹配给定时间范围内的所有精确值
- 支持
and
运营商。
现在我想扩展查询以支持部分匹配,但我很难做到这一点。任何意见,将不胜感激。
映射
"event": {
"properties": {
"alarmId": {
"type": "string",
"index": "not_analyzed"
},
"startTimestamp": {
"type": "long"
},
...
}
}
当前查询
{
"bool": {
"must":[
{"range": {"endTimestamp": {"gte": ?0}}},
{"range": {"startTimestamp": {"lte": ?1}}}
],
"should": [
{"match": {"_all": {"query": "?2", "zero_terms_query": "all", "operator": "and"}}}
],
"minimum_should_match" : 1
}
}