jdotjdot
jdotjdot

Reputation: 17082

Algolia: Search multiple geos simultaneously?

Is there any way to search for items within distance of a lat/long for multiple lat/longs simultaneously? E.g., to say "give me all results within 10 miles of 14.2342,-13.234234 AND 1.3234,4.56775"?

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

Upvotes: 4

Views: 374

Answers (1)

Alex C
Alex C

Reputation: 465

In its current version, the API only allows to pass one lat/long value at a time. Nevertheless, it allows to pass multiple bounding boxes at the same time. That means that you could easily calculate the bounding boxe coordinates (see How to calculate the bounding box for a given lat/lng location?), and pass those to the search parameters.

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

Upvotes: 1

Related Questions