Hello! Is there a way of knowing the individual di...
# community-help
g
Hello! Is there a way of knowing the individual distance of each result when filtering by geopoint?
a
Oh .. I'd like to know that too!
k
Distance from the search query point?
a
That woud be what interests me, Kishore. I guess thats what @Guillermo Dorfman means, but he should confirm
g
Yes, exactly. I can sort them by distance to the search query point but I’d like to know exactly how close they are.
Im guessing that information is available somewhere since the calculation is already been made
k
Check the
geo_distance_meters
in the search response. You can see example in the response here: https://typesense.org/docs/0.23.1/api/geosearch.html#searching-within-a-radius
a
Thanks @Kishore Nallan
g
Yes I saw that but its not showing up in the response. All I’m getting on every hit is ‘document’, ‘highlights’ and ‘text_match’.
Trying to access geo_distance_meters returns null
k
That field is only shown when you have a
sort_by
clause. Do you have that in your query? If not, can you post a minimally reproduceable example for me to run and check?
g
Ah I see. No, currently I’m not using
sort_by
Added the sort_by clause and that did it, Thank you!
k
Awesome. Without sort by there is no reference point for calculating the distance.