Elasticsearch 聚合查询学习
Elasticsearch 聚合查询学习
聚合查询
Bucketing
每个桶和一个文档的key相关联,符合条件的数据落入一个桶内
Adjacency Matrix Aggregation
邻接矩阵聚合,也就是求交集,假设es中的数据, name: kyle 有2条, name: lola 有4条, name: aiden 有1条
|
|
a | b | c | |
---|---|---|---|
a | a | a&b | a&c |
b | b | b&c | |
c | c |
Auto-interval Date Histogram Aggregation
|
|
Composite aggregation
组合查询
|
|
|
|
Date histogram aggregation
|
|
Date Range Aggregation
range aggregation this is dedicated for date values. date 字段专用
|
|
Filter Aggregation
通常用于将聚合应用于一组特定的文档。
|
|
Filters Aggregation
|
|
Global Aggreation
Global aggregators can only be placed as top level aggregators
|
|
Histogram Aggregation
|
|
Missing Aggregation
|
|
Nested Aggregation
用于nested字段类型的聚合
|
|
Reverse nested Aggregation
待详细研究
Range Aggregation
参考 Date Range Aggregation,类似
Rare Terms
就像是一个terms按_count 升序排序的聚合,实际上通过计数升序对术语agg进行排序具有无限误差
|
|
Significant_terms Aggregation
Sampler Aggregation
Diversified Sampler Aggregation
先看significant_terms aggregation
Metrics
计算一组文档的指标
Cardinality Aggregation
计算不同值得近似计数
|
|
Stats Aggregation
The stats that are returned consist of: min
, max
, sum
, count
and avg
|
|
Extended Stats Aggregation
对stats的扩展
|
|
Median Absolute Deviation Aggregation
中位数绝对偏差
|
|
Scripted Metric Aggregation
未明白含义
String Stats Aggregation
|
|
Top Hits Aggregation
|
|
Top Hits Aggregation
值得研究,暂未看懂
Matrix
不支持脚本,可以在多个字段上操作,并根据请求的文档字段中提取的值生成矩阵结果。
Pipeline
聚合其他聚合的输出结果及其相关指标