Using geo queries
Geo queries (https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-queries.html) of Elasticsearch allow finding the records using a bounding box, distance from a given geo point, or the records lying within the polygon made up of geo points specified as a bounding region. The Helping Hands application requires geo queries for two of its routes, GET /lookup/geo and GET /validate/:service.
The first route allows consumers to look up available services within the specified bounding box of a latitude and longitude pair that can be selected via a map by drawing a rectangle. Alternatively, consumers can also look up a service within, say, a 5km radius of their location specified by their geolocation. Similarly, the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access