geoWithin metadata reporting searchDistance
Using geoWithin in the $search aggregation pipeline lets me use the search indexes, but it doesn't let me see the distance. I'd love to have a distanceField or perhaps a $meta that reports searchDistance similar to the one we have for searchScore
For my use case I need to search data based on location and text, and be able to sort it by proximity.
If this features is not implemented, I need to either split the query into two, to perform a search and then pass the results to a $geoWithin filtering by the IDs of the previous pipeline, or, to query for all items that match the search and geo restrictions and then calculate proximity on server, having to transfer a lot of unnecessary data.
Being able to sort results by relevance OR by distance is critical for many use cases. I'd love to see this feature make it into a future release!