Geo
The search servers such as Elasticsearch are usually looked at from the perspective of full-text searching. However, this is only a part of the whole view. Sometimes, a full-text search is not enough. Imagine searching for local services. For the end user, the most important thing is the accuracy of the results. By accuracy, we not only mean the proper results of the full-text search, but also the results being as near as they can in terms of location. In several cases, this is the same as the text search on geographical names such as cities or streets, but in other cases, we can find it very useful to be able to search on the basis of the geographical coordinates of our indexed documents. And, this is also a functionality that Elasticsearch is capable of handling.
Mappings preparation for spatial search
In order to discuss the spatial search functionality, let's prepare an index with a list of cities. This will be a very simple index with one type named poi
(which stands for the point...