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
GeoBoundingBox query should work on bounding box with equal latitude or longitude #85788
Conversation
💚 CLA has been signed |
Pinging @elastic/es-analytics-geo (Team:Analytics) |
@elasticmachine test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great. For completeness, could we add a test on GeoBoundingBoxQueryIntegTestCase
?
Sure. |
Just checking in here, how are you doing with the requested change? |
Hello, @iverase . public void testSimpleBoundingBoxTest() throws Exception {
Settings settings = Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, randomSupportedVersion()).build();
XContentBuilder xContentBuilder = getMapping();
assertAcked(prepareCreate("test").setSettings(settings).setMapping(xContentBuilder));
ensureGreen();
client().prepareIndex("test")
.setId("1")
.setSource(jsonBuilder().startObject().field("name", "New York").field("location", "POINT(-74.0059731 40.7143528)").endObject())
.get();
client().admin().indices().prepareRefresh().get();
SearchResponse searchResponse = client().prepareSearch()
.setQuery(geoBoundingBoxQuery("location").setCorners(40.7143528, -74.0059731, 40.7143528, -74.0059731))
.get();
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));
assertThat(searchResponse.getHits().getHits().length, equalTo(1));
for (SearchHit hit : searchResponse.getHits()) {
assertThat(hit.getId(), equalTo("1"));
}
} |
Umm, I tried to reproduce it but I cannot. Maybe you need to update your branch with the latest master, there was a change recently that might help here: #85441 |
Thank you very much again! |
…ual latitude or longitude
…ual latitude or longitude
I rebased PR onto latest master(9ae5885). |
@elasticmachine test this please |
It seems some of the checks are failing:
My advise is to run locally on the PR |
Oh, I'm sorry. |
Hello, @iverase. |
@elasticmachine test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @jchrys for the contribution, the PR is now merged. @glennvill pinging you so you can check the final PR. |
@iverase |
This PR removes the validation checkers for latitude/ longitude equality and adds test cases that covers the changes.
fixes #77717