diff --git a/docs/Filter/GeoBoundingBox.md b/docs/Filter/GeoBoundingBox.md index 9a2e1172f9ccb249ce667e8c1fa7d9c3034ce7ae..2d3e23edc4d964286a21118ae59edd67c9754ad9 100644 --- a/docs/Filter/GeoBoundingBox.md +++ b/docs/Filter/GeoBoundingBox.md @@ -47,4 +47,44 @@ $search->addFilter($geoBoundingBoxFilter); $queryArray = $search->toArray(); ``` +Other format + +```JSON +"filtered" : { + "query" : { + "match_all" : {} + }, + "filter" : { + "geo_bounding_box" : { + "pin.location" : { + "top" : -74.1, + "left" : 40.73, + "bottom" : -71.12, + "right" : 40.01 + } + } + } +} +``` + +In DSL + +```php +$geoBoundingBoxFilter = new GeoBoundingBoxFilter( + 'pin.location', + [ + -74.1, + 40.73, + -71.12, + 40.01, + ] +); + +$search = new Search(); +$search->addFilter($geoBoundingBoxFilter); + +$queryArray = $search->toArray(); +``` + + [1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-bounding-box-filter.html