Open dw-alex opened 3 years ago
Pinging @elastic/es-analytics-geo (Team:Analytics)
I'll hopefully have some bandwidth to fix https://github.com/elastic/elasticsearch/pull/66756 this week and next which is related to this
Until this is resolved, _geo_distance sort docs should be updated to clearly state that geo_shape is not supported.
Here is an example of how this API inconsistency between geo_distance geo_shape support and _geo_distance lack of geo_shape support causes user confusion and a poor experience.
Hi @iverase @djptek. Do you know if this is still an open issue ? Or if any workaround is possible to sort by distance for geo_shape ? Thanks
@thibaultclem I'm not currently working on this - thoughts @iverase?
It is still an open issue. It is a tricky one because while we compute distance using spherical mathematics, our shapes are not spherical, e.g edges are not big circles. Therefore we need to add new functionality that is still not there.
You can sort using the geo-shape centroid but I understand it is not the same and results can be surpising.
Thanks a lot for your quick answer. Yes I understand that it's not as simple as for geo-point. Unfortunately we cannot use the centroid... The issue is that biggest geo object (in our case buildings with huge footprint) are too disadvantaged compare to smaller one. I will keep follow this issue. Best
Now that
geo_distance
is enable forgeo_shape
field type (via #53466, #64326, and #64224) it would be great to allow_geo_distance
sort ongeo_shape
field type.