Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow _geo_distance sort on geo_shape field type #68953

Open
dw-alex opened this issue Feb 12, 2021 · 7 comments
Open

Allow _geo_distance sort on geo_shape field type #68953

dw-alex opened this issue Feb 12, 2021 · 7 comments
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)

Comments

@dw-alex
Copy link

dw-alex commented Feb 12, 2021

Now that geo_distance is enable for geo_shape field type (via #53466, #64326, and #64224) it would be great to allow _geo_distance sort on geo_shape field type.

@dw-alex dw-alex added >enhancement needs:triage Requires assignment of a team area label labels Feb 12, 2021
@iverase iverase added :Analytics/Geo Indexing, search aggregations of geo points and shapes and removed needs:triage Requires assignment of a team area label labels Feb 15, 2021
@elasticmachine elasticmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Feb 15, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

@djptek
Copy link
Contributor

djptek commented Feb 15, 2021

I'll hopefully have some bandwidth to fix #66756 this week and next which is related to this

@nreese
Copy link
Contributor

nreese commented Jun 4, 2022

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.

@thibaultclem
Copy link

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

@djptek
Copy link
Contributor

djptek commented May 31, 2024

@thibaultclem I'm not currently working on this - thoughts @iverase?

@iverase
Copy link
Contributor

iverase commented May 31, 2024

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.

@thibaultclem
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)
Projects
None yet
Development

No branches or pull requests

6 participants