您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
elasticSearch扩展统计聚合
发布时间:2021-09-03 11:17:12编辑:雪饮阅读()
ElasticSearch扩展统计聚合类似于上篇中的统计汇总。那么就如字面意思,这里统计出来的字段数量比统计汇总统计出来的响应出更多的聚合信息。不仅仅是最大、最小值、平均聚合、求和聚合、count聚合等。
一个请求如:
请求正文:
{
"aggs" : {
"fees_stats" : { "extended_stats" : { "field" : "fees" } }
}
}
响应正文:
{
"took": 5,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 5,
"relation": "eq"
},
"max_score": null,
"hits": []
},
"aggregations": {
"fees_stats": {
"count": 4,
"min": 2004.0,
"max": 5000.0,
"avg": 3876.0,
"sum": 15504.0,
"sum_of_squares": 6.6266016E7,
"variance": 1543128.0,
"variance_population": 1543128.0,
"variance_sampling": 2057504.0,
"std_deviation": 1242.2270323898124,
"std_deviation_population": 1242.2270323898124,
"std_deviation_sampling": 1434.4002230897763,
"std_deviation_bounds": {
"upper": 6360.454064779625,
"lower": 1391.5459352203752,
"upper_population": 6360.454064779625,
"lower_population": 1391.5459352203752,
"upper_sampling": 6744.800446179553,
"lower_sampling": 1007.1995538204474
}
}
}
}
关键字词:elasticSearch,扩展统计聚合,扩展统计,聚合