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

Add geo hash grid aggregation doc.

parent be90ef3c
No related branches found
No related tags found
No related merge requests found
# Geo Hash Grid Aggregation
> More info about geo hash grid aggregation is in the [official elasticsearch docs][1]
A multi-bucket aggregation that works on geo_point fields and groups points into buckets
that represent cells in a grid.
## Simple example
```JSON
{
"aggregations" : {
"agg_GrainGeoHashGrid" : {
"geohash_grid" : {
"field" : "location",
"precision" : 3
}
}
}
}
```
And now the query via DSL:
```php
$geoHashGridAggregation = new GeoHashGridAggregation(
'GrainGeoHashGrid',
'location',
3
);
$search = new Search();
$search->addAggregation($geoHashGridAggregation);
$queryArray = $search->toArray();
```
[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geohashgrid-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