Geo
Search servers such as ElasticSearch are usually looked at from the perspective of full text search. This is only partially true. Sometimes the text search is not enough. Imagine searching for local services. For the end user the most important thing is the accuracy of results, but by accuracy we not only mean the proper results of full text search, but also the results being as near as they can in terms of location. In some cases this is the same as 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 geographical coordinates of our indexed documents. As you can guess, this is of course also something that is supported by ElasticSearch.
Mapping 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 point of interest) with name of the city and its...