原文地址: https://www.elastic.co/guide/en/elasticsearch/guide/current/geo-aggs.html, 版权归 www.elastic.co 所有
WARNING: The 2.x versions of Elasticsearch have passed their EOL dates. If you are running a 2.x version, we strongly advise you to upgrade.
This documentation is no longer maintained and may be removed. For the latest information, see the current Elasticsearch documentation.
Geo Aggregationsedit
Although filtering or scoring results by geolocation is useful, it is often more useful to be able to present information to the user on a map. A search may return way too many results to be able to display each geo-point individually, but geo-aggregations can be used to cluster geo-points into more manageable buckets.
Three aggregations work with fields of type geo_point
:
-
geo_distance
- Groups documents into concentric circles around a central point.
-
geohash_grid
- Groups documents by geohash cell, for display on a map.
-
geo_bounds
-
Returns the
lat/lon
coordinates of a bounding box that would encompass all of the geo-points. This is useful for choosing the correct zoom level when displaying a map.