Elasticsearch 5.x date range 查询
程序员文章站
2022-07-05 09:04:29
...
{
"size": 0,
"query": {
"match": {
"appName": "zis-search-za-search-service.prd.za-tech.net"
}
},
"aggs": {
"range": {
"date_range": {
"field": "time",
"format": "yyyy-MM-dd HH:mm:ss",
"time_zone": "+08:00",
"ranges": [
{
"from": "now-2m"
}
]
},
"aggs": {
"sum_request_length": {
"sum": {
"field": "request_length"
}
}
}
}
}
}
上一篇: 经典问题生产者/消费者问题
下一篇: java 读写者问题 实现