How can we improve Azure Search?

Support for Geo.distance function on customer location compared to index data

We have clients that we want to expose using the search feature. They do not want to appear if customer is outside there catchment area.
The Geo.Distance function can only be compared to fixed data.
I'd like to compare this with data held in the index.

65 votes
Sign in
Sign in with: Microsoft
Signed in as (Sign out)
You have left! (?) (thinking…)
Ian Powell shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →


Sign in
Sign in with: Microsoft
Signed in as (Sign out)
  • [Deleted User] commented  ·   ·  Flag as inappropriate

    I have a good example which is similar. We have a location and radius in the index (radius in meters). I want to be able to filter the results where the distance from index location to passed in location is less than the indexed radius.

  • Bruce Johnston commented  ·   ·  Flag as inappropriate

    @Pablo J: There is no update at this time.

    Implementing this is actually not as easy as it looks. The difficulty is in the fact that we rely on one of the parameters being constant for the purposes of lookup in the inverted index. It isn't clear to us how to implement this efficiently enough to meet typical expectations of query performance.

    Right now we're focusing on items with many more votes than this, but if this gets enough votes we'll revisit it.

  • Pablo J commented  ·   ·  Flag as inappropriate

    any update on this?

    it doesn't *seem* like a huge change and there are plenty of valid use cases.

  • Bruce Johnston - MSFT commented  ·   ·  Flag as inappropriate

    To clarify, is the functionality you're looking for this:

    geo.distance(location1, location2) lt 100

    where "location1" and "location2" are fields in the same index, or more like this:

    geo.distance(location1, POINT(-127.89734578345 45.234534534)) lt distanceField

    where "distanceField" is a numeric field in the same index?

Feedback and Knowledge Base