E
E
Elasticsearch 高手之路
Search…
E
E
Elasticsearch 高手之路
Introduction
First Chapter
1.ElasticSearch 5.x 安装
2.基础学前班
3.基础
3.1.配置文件
3.2.Mapping
3.3. Analysis(分析)
3.4. APIs
3.5.Query DSL(DSL方式查询)
3.6.Aggregations(聚合分析)
3.6.1.量度聚合(Metric Aggregations)
平均值聚合(Avg Aggregation)
基数聚合(Cardinality Aggregation)
扩展统计聚合( Extended Stats Aggregation)
地理边界聚合(Geo Bounds Aggregation)
地理重心聚合(Geo Centroid Aggregation)
最大值聚合(Max Aggregation)
最小值聚合(Min Aggregation)
Percentiles Aggregation
Percentile Ranks Aggregation
Scripted Metric Aggregation
Stats Aggregation
总和聚合(Sum Aggregation)
Top hits Aggregation
Value Count Aggregation
3.6.2.桶聚合(Bucket Aggregations)
3.6.3.管道聚合(Pipeline Aggregations)
3.6.4.矩阵聚合(Matrix Aggregations)
3.6.5.缓存频繁聚合(Caching heavy aggregations)
3.6.6.仅返回需要聚合的结果(Returning only aggregation results)
3.6.7.聚合元数据(Aggregation Metadata)
3.6.8.返回聚合的类型(Returning the type of the aggregation)
Glossary of terms (词汇表)
未完成的任务
4.基础补充总结
原理
实战
PHP API
资料
笔记
Powered By
GitBook
地理边界聚合(Geo Bounds Aggregation)
地理边界聚合是一个度量聚合,为一个字段计算包含所有地点值的边界框。
例如:
{
"query" : {
"match" : { "business_type" : "shop" }
},
"aggs" : {
"viewport" : {
"geo_bounds" : {
"field" : "location", # 1
"wrap_longitude" : true # 2
}
}
}
}
1
地理边界聚合指定一个字段用来获得边界。
2
wrap_longitude是一个可选参数,指定边界框是否允许与国际日期变更线重叠,默认值是true。
上面的聚合实例表示查询所有业务类型为商店的文档,并且根据文档中的位置字段计算出边界框。
上面聚合语句的返回值为:
{
...
"aggregations": {
"viewport": {
"bounds": {
"top_left": {
"lat": 80.45,
"lon": -160.22
},
"bottom_right": {
"lat": 40.65,
"lon": 42.57
}
}
}
}
}
Previous
扩展统计聚合( Extended Stats Aggregation)
Next
地理重心聚合(Geo Centroid Aggregation)
Last modified
3yr ago
Copy link