按 dlmc 字段分组,对 tbmj 字段求和、求平均值
{ "aggs": { "group_by_dlmc_sum": { "terms": { "size": 1000, "field": "dlmc.keyword" }, "aggs": { "tbmj_sum": { "sum": { "field": "tbmj" } } } }, "group_by_dlmc_avg": { "terms": { "size": 1000, "field": "dlmc.keyword" }, "aggs": { "tbmj_avg": { "avg": { "field": "tbmj" } } } } } }
参考链接
https://www.tizi365.com/archives/644.html
https://juejin.cn/s/elasticsearch%20%E5%88%86%E7%BB%84%E6%B1%82%E5%92%8C
标签:dlmc,平均值,求和,sum,tbmj,field,elasticsearch,aggs,avg From: https://www.cnblogs.com/nihaorz/p/17565375.html