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

Add geohash cell filter doc.

parent a9fb9472
No related branches found
No related tags found
No related merge requests found
# Geohash Cell Filter
> More info about geohash cell filter is in the [official elasticsearch docs][1]
The geohash cell filter provides access to a hierarchy of geohashes.
By defining a geohash cell, only geopoints within this cell will match this filter.
## Simple example
```JSON
{
"filtered" : {
"query" : {
"match_all" : {}
},
"filter" : {
"geohash_cell": {
"pin": {
"lat": 13.4080,
"lon": 52.5186
},
"precision": 3,
"neighbors": true
}
}
}
}
```
And now the query via DSL:
```php
$geohashCellFilter = new GeohashCellFilter(
'pin',
[
'lat' => 13.4080,
'lon' => 52.5186,
],
[
'precision' => 3,
'neighbors' => true,
]
);
$search = new Search();
$search->addFilter($geohashCellFilter);
$queryArray = $search->toArray();
```
[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geohash-cell-filter.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