查询 出 userName 是 admin , operateTime在 2020-05-18 00:00:00 和2020-05-25 00:00:00之间,并且 logType 是 浏览,回放,暂停 中的任何一个。
相当于SQL select * from log_info where userName = 'admin' and operateTime > 2020-05-18 00:00:00 and operateTime < 2020-05-18 00:00:00 and logType in ('浏览','回放','暂停')
{
"query": {
"bool": {
"must": [
{
"match": {
"userName": "admin"
}
},
{
"range": {
"operateTime": {
"gt": "2020-05-18 00:00:00",
"lt": "2020-05-25 00:00:00"
}
}
},
{
"bool": {
"should": [
{
"match": {
"logType": "浏览"
}
},
{
"match": {
"logType": "回放"
}
},
{
"match": {
"logType": "暂停"
}
}
]
}
}
]
}
},
"aggs": {}
}