WARNING: Version 1.5 of Elasticsearch has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
Geo Bounds Aggregation
editGeo Bounds Aggregation
editThis functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
A metric aggregation that computes the bounding box containing all geo_point values for a field.
Example:
{ "query" : { "match" : { "business_type" : "shop" } }, "aggs" : { "viewport" : { "geo_bounds" : { "field" : "location", "wrap_longitude" : true } } } }
The |
|
|
The above aggregation demonstrates how one would compute the bounding box of the location field for all documents with a business type of shop
The response for the above aggregation:
{ ... "aggregations": { "viewport": { "bounds": { "top_left": { "lat": 80.45, "lon": -160.22 }, "bottom_right": { "lat": 40.65, "lon": 42.57 } } } } }