With AlgoliaSearch, Is it possible to "filter" by one geo location, but then "sort" by another?

Hi everyone,

Hoping I can get some help or at least direction here!

Essentially, I have one geo location that I want to filter by. That all works fine using aroundLatLng, no problems here. But I also want to sort by a different geo location…

As per the documentation, when you provide an aroundLatLng the results are filtered and sorted by distance to the associated geo location. But in my scenario, I want to sort by a different geo location.

As a real world example, imagine you want to filter by a geo location, let’s say that of New York, but you then want to sort those results by the users location so they can find what’s around them in New York.

I understand this is something that could be done outside Algolia, but I suspect it would require requesting the entire result set and sorting it manually. When the result set could be 1000’s of records long, this doesn’t seem ideal.

And, if we set a hitsPerPage (of say 20) and did the same, the next page wouldn’t be accurate - as we haven’t considered the geo location of the other x records against the users location.

Any thoughts, ideas or pointers would be great!