Using the geo_bounding_box query
One of the most common operations in geo-localization is searching for a box (square). The square is usually an approximation of the shape of a shop, a building, or a city.
This kind of query can be used in a percolator for real-time monitoring if users, documents, or events are entering a special place.
Getting ready
You need an up-and-running Elasticsearch installation, as we described in the Downloading and installing Elasticsearch recipe in Chapter 1, Getting Started.
To execute these commands, any HTTP client can be used, such as curl (https://curl.haxx.se/), Postman (https://www.getpostman.com/), or similar. I prefer using the Kibana console, as it provides code completion, formatting, and better character escaping for Elasticsearch.
To correctly execute the following commands, you will need an index populated with the ch04/populate_kibana.txt
commands, which are available in the online code.
The...