elasticsearch集群nested嵌套统计
2020-12-21 leiting (4086阅读)
标签 Elasticsearch
{ "size": 0, "aggs": { "my_id": { "terms": { "field": "id",//嵌套父级的字段 "size": 1000 }, "aggs": { "my_date": { "nested": {//嵌套结构 "path": "all_dates" }, "aggs": { "my_price": { "avg": {//求每个ID下嵌套结构里价格的平均值 "field": "all_dates.price" } } } } } } } }
最新评论:
最新评论: