es数据库 简单查询

2020-01-10  本文已影响0人  刘东青_6f21

{

"size": 0,
"query": {
    "bool": {
        "must": [{
            "range": {
                "start_time": {
                    "gte": "2020/01/08 19:56:00",
                    "lte": "2020/01/08 21:00:00"
                }
            }
        }]
    }
},
"aggs": {
    "equ_name": {
        "terms": {
            "field": "equ_name.keyword"
        } 
    }
}

}

select equ_name,count(*) from xxx where start_time between xx and xx group by equ_name

上一篇下一篇

猜你喜欢

热点阅读