One of the most common operations in geolocalization is searching for a box (square).
You need a working ElasticSearch cluster and the data populated with the geo populate script.
A search to filter documents related to a bounding box of dimensions (40.03
, 72.0
) and (40.717
* 70.99
) can be done by using a similar query as follows:
curl -XGET http://127.0.0.1:9200/test-mindex/_search -d '{ "query": { "filtered": { "filter": { "geo_bounding_box": { "pin.location": { "bottom_right": { "lat": 40.03, "lon": 72.0 }, "top_left": { "lat": 40.717, "lon": 70.99 } } } }, "query": { "match_all": {} ...