Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试从日期时间字段中获取汇总信息:
谢谢大家。
您可以使用聚合format参数并仅选择其中的字段。您的聚合看起来像date-histogrammonth
format
date-histogram
month
{ "aggs": { "documents_by_month": { "date_histogram": { "field": "date", "interval": "1M", "format": "MM" }, "aggs": { "documents": { //... your sub aggregation } } } } }