Is it possible to sort by distance in algolia using geo
data? I mean not just a vector distance between the points (https://www.algolia.com/doc/guides/geo-search/geo-search-overview/#sorting-by-distance). I mean a route length (like in google maps: https://www.dmxzone.com/downloads/images/Image012_13.png)
Asked
Active
Viewed 304 times
0

Nikita Sviridenko
- 79
- 1
- 8
1 Answers
0
I'm sure Algolia doesn't support out of box for your requirement. You need to build logic before inserting data into Algolia or after getting data from Algolia.
I would suggest to pass ranking(route length) along with each data. You can calculate this using lat, long etc. Later just use this ranking field in sorting to get the nearest route. I did this & so far it is working as expected.

atpatil11
- 438
- 4
- 13