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

geo_polygon query using point does not properly validate longitude values #30488

Closed
jamieswogger opened this issue May 9, 2018 · 2 comments
Closed
Assignees
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes >bug

Comments

@jamieswogger
Copy link

Elasticsearch version (bin/elasticsearch --version): 5.6.3 (bug also appears to be on master)

Plugins installed: []

JVM version (java -version): 1.8.0_161

OS version (uname -a if on a Unix-like system): Darwin

Description of the problem including expected versus actual behavior:
When using a geo_polygon query using points, I would expect any lon value < -180 or > 180 to be invalid and return an error similar to the one returned when any lat value is < -90 or > 90. Looking at the code here the check does exist but is using the lat value instead of the lon value.

This also appears to exist in the current master version (link to code here)

Steps to reproduce:

You can reproduce by running a geo_polygon query using lat/long points in elasticsearch 5.6.3. Note that you will need a geo_point field to query against. Using a lat of < -90 or > 90 will return an error about an illegal latitude value, but using a lon of < -180 or > 180 will not return an error.

Based on the code link above, I would also assume you could do the same on any version > 5.6.3.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@nik9000 nik9000 added :Analytics/Geo Indexing, search aggregations of geo points and shapes >bug labels May 9, 2018
@imotov imotov self-assigned this May 9, 2018
@imotov
Copy link
Contributor

imotov commented May 9, 2018

Tested it in 6.x and it looks like the query with invalid longitude actually fails but with a quite convoluted error that is generated during polygon validation.

imotov added a commit to imotov/elasticsearch that referenced this issue May 9, 2018
Fixes longitude validation in geo_polygon_query builder. The queries
with wrong longitude currently fail but only later during polygon
with quite complicated error message.

Fixes elastic#30488
imotov added a commit that referenced this issue May 10, 2018
Fixes longitude validation in geo_polygon_query builder. The queries
with wrong longitude currently fail but only later during polygon
with quite complicated error message.

Fixes #30488
imotov added a commit that referenced this issue May 10, 2018
Fixes longitude validation in geo_polygon_query builder. The queries
with wrong longitude currently fail but only later during polygon
with quite complicated error message.

Fixes #30488
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 >bug
Projects
None yet
Development

No branches or pull requests

4 participants