Algolia: search for several geos at the same time?

Is there a way to search for elements at lat / long distance for several lats / lengths at the same time? For example, say "give me all the results within 10 miles of 14.2342, -13.234234 and 1.3234.4.56775"?

Currently, I only see the ability to search one set of coordinates at a time.

+4
source share
1 answer

In its current version, the API allows passing only one lat / long value at a time. However, it allows you to simultaneously transmit multiple bounding rectangles. This means that you can easily calculate the border coordinates of the box (see How to calculate the bounding box for a given lat / lng location? ) And pass them to the search parameters.

You can find here the https://www.algolia.com/doc/tutorials/geo-search manual (+ sample code) showing how geolocation search works. And more about boundingBox options at https://www.algolia.com/doc/rest#param-insideBoundingBox

+3
source

Source: https://habr.com/ru/post/1625681/


All Articles