疲劳是最舒适的枕头,努力工作吧。

多个field的exists,or逻辑怎么写?在线等

Elasticsearch | 作者 Octocat | 发布于2017年11月29日 | 阅读数:4528

我的检索条件是:指定时间内 time ∈[a, b],存在 A 字段或者存在B字段?DSL语句要怎么写?在线等大神。。。
已邀请:

living

赞同来自:

{
"query": {
"bool": {
"must": [
{
"bool": {
"should": [
{
"match": {
"terms": "a"
}
},
{
"match": {
"terms": "b"
}
}
]
}
},
{
"range": {
"@timestamp": {
"lte": 1511931004000
}
}
},
{
"range": {
"@timestamp": {
"gte": 1511928844000
}
}
}
]
}
}
}

要回复问题请先登录注册