Skip to content

Refactors GeoDistanceQueryBuilder/-Parser#13496

Closed
cbuescher wants to merge 1 commit intoelastic:feature/query-refactoringfrom
cbuescher:feature/query-refactoring-geodistance
Closed

Refactors GeoDistanceQueryBuilder/-Parser#13496
cbuescher wants to merge 1 commit intoelastic:feature/query-refactoringfrom
cbuescher:feature/query-refactoring-geodistance

Conversation

@cbuescher
Copy link
Copy Markdown
Member

Splits parsing and Lucene query generation. Switches from storing lat/lon
separately to using GeoPoint instead.

Relates to #10217

@cbuescher
Copy link
Copy Markdown
Member Author

This PR continues #12283, so maybe @MaineC wants to take a look at it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the lat() and lon() methods? We don't want people setting lat but not lon so it don't makes sense (IMO) to allow them to be set separately

@cbuescher cbuescher force-pushed the feature/query-refactoring-geodistance branch 2 times, most recently from 32746b1 to 511ba0e Compare September 11, 2015 10:07
@cbuescher
Copy link
Copy Markdown
Member Author

@colings86 thanks for the comments, added small changes according to this and also minor changes to the GeoDistanceRange/PolygonQ.B. using new utility methods and writable GeoPoint from this PR. Glad if you want to take another look at that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should throw an IOException with a nice message if the read int is greater than values().length. See ShapeRelation for example of what I mean. We also need unit tests to make sure the ordinals don't change. See ShapeRelationTests for an example of that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, unit test already exists, I will combine the existing two classes in the following commit.

@colings86
Copy link
Copy Markdown
Contributor

@cbuescher Left some more comments but I think it's close

@cbuescher
Copy link
Copy Markdown
Member Author

@colings86 adressed your comments, other than the helper method in ESTestCase which I'd prefer to keep there I think I adressed your comments. Would also like for @MaineC to have a final look since this PR contains many of her own changes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we are currently trying to get rid of guava as a dependency - switch from using Preconditions to an explicit check?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Search/Search Search-related issues that do not fall into other categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants