Skip to content
Snippets Groups Projects
Commit 042e97fa authored by Aivaras Gotovskis's avatar Aivaras Gotovskis
Browse files

Add geo bounds aggregation doc.

parent a4c9b297
No related branches found
No related tags found
No related merge requests found
# Geo Bounds Aggregation
> More info about geo bounds aggregation is in the [official elasticsearch docs][1]
A metric aggregation that computes the bounding box containing all geo_point values for a field.
## Simple example
```JSON
{
"aggregations" : {
"agg_viewport" : {
"geo_bounds" : {
"field" : "location",
"wrap_longitude" : true
}
}
}
}
```
And now the query via DSL:
```php
$geoBoundsAggregation = new GeoBoundsAggregation('viewport', 'location');
$search = new Search();
$search->addAggregation($geoBoundsAggregation);
$queryArray = $search->toArray();
```
[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-geobounds-aggregation.html
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment