es数据库 简单查询

{

"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

你可能感兴趣的:(es数据库 简单查询)