|NO.Z.00030|——————————|BigDataEnd|——|Hadoop&ElasticSearch.V30|——|ELK.v30|集群|QueryDSL|聚合分析.V1|

一、聚合分析
### --- 聚合介绍

~~~     聚合分析是数据库中重要的功能特性,完成对一个查询的数据集中数据的聚合计算,
~~~     如:找出某字段(或计算表达式的结果)的最大值、最小值,计算和、平均值等。
~~~     Elasticsearch作为搜索引擎兼数据库,同样提供了强大的聚合分析能力。
~~~     对一个数据集求最大、最小、和、平均值等指标的聚合,
~~~     在ES中称为指标聚合 metric 而关系型数据库中除了有聚合函数外,
~~~     还可以对查询出的数据进行分组group by,再在组上进行指标聚合。
~~~     在 ES 中group by 称为分桶,桶聚合bucketing
~~~     Elasticsearch聚合分析语法 在查询请求体中以aggregations节点按如下语法定义聚合分析:
### --- 语法:说明:aggregations 也可简写为 aggs

"aggregations" : {
"<aggregation_name>" : { <!--聚合的名字 -->
"<aggregation_type>" : { <!--聚合的类型 -->
<aggregation_body> <!--聚合体:对哪些字段进行聚合 -->
}
[,"meta" : { [<meta_data_body>] } ]? <!--元 -->
[,"aggregations" : { [<sub_aggregation>]+ } ]? <!--在聚合里面在定义子聚合 -->
}
}

 
 
 
 
 
 
 
 
 

Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
                                                                                                                                                   ——W.S.Landor

 

 

posted on   yanqi_vip  阅读(20)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示