2

I was playing around with the select for querying the index. I wanted to return a distance for a GeographyPoint I have in the index. I was trying something like this: where GeoPoint is the location field

$select=ID,geo.distance(GeoPoint, geography'POINT(-122.131577 47.678581)')

Is there a way to return distance in a Select statement if you have the lat and long and the location?

Thanks!

Zekokhan
  • 193
  • 1
  • 6

2 Answers2

1

Azure Search does not currently support returning the result of geo.distance in the search response. Please vote for the feature on User Voice to help us prioritize.

As a workaround, you can calculate the distance yourself. This forum thread and this answer describe a few ways to do this.

Bruce Johnston
  • 8,344
  • 3
  • 32
  • 42
0

Even I wished it would work

But you cannot directly get the distance by using 'select'. It is currently enabled only as a filter and orderby property.

'SELECT' can be used only on the field names

gd vigneshwar
  • 847
  • 1
  • 9
  • 19