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

Lat/Long are Reversed In GeoDistanceFilterBuilder #4204

Closed
darylrobbins opened this issue Nov 19, 2013 · 2 comments
Closed

Lat/Long are Reversed In GeoDistanceFilterBuilder #4204

darylrobbins opened this issue Nov 19, 2013 · 2 comments

Comments

@darylrobbins
Copy link

The latitude and longitude values are being reversed by the GeoDistanceFilterBuilder when attempted to construct a search. I have had to do the following in my client code:

searchClient.prepareSearch("stores")
        .setTypes("store")
        .setQuery(QueryBuilders.matchAllQuery())
        .setFilter(FilterBuilders.geoDistanceFilter("location")
        .lat(longitude)          // BUG: These are reversed in the ES API
        .lon(latitude)

The issue is with the following line of code:
https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/index/query/GeoDistanceFilterBuilder.java#L125

Fixing this issue would however break the backwards compatibility of the API, if anyone happened to be relying on this functionality being reversed to get their application working.

@kimchy
Copy link
Member

kimchy commented Nov 19, 2013

Its not reversed, right? When using the array format, we conform to the geojson spec, and do [lon, lat].

@darylrobbins
Copy link
Author

Well, that explains it. Thanks!

imotov added a commit that referenced this issue May 9, 2018
Adds initial very minimal support for geo_shapes to SQL. For now, geoshapes are
converted into String instead of Geometry objects on the JDBC side and no effort
to parse the result is performed.

Relates #4080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants