Skip to content

Refactor of GeoPolygonQuery#13426

Merged
colings86 merged 1 commit intoelastic:feature/query-refactoringfrom
colings86:refactor/geo-polygon-query
Sep 11, 2015
Merged

Refactor of GeoPolygonQuery#13426
colings86 merged 1 commit intoelastic:feature/query-refactoringfrom
colings86:refactor/geo-polygon-query

Conversation

@colings86
Copy link
Copy Markdown
Contributor

Moving the query building functionality from the parser to the builders
new toQuery() method analogous to other recent query refactorings.

Relates to #10217

PR goes against the query-refactoring branch

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.

I'd slightly prefer to do this before or into a copy of the shape? I think only the latter is possible though, not sure. Also, maybe it is not a big deal to auto close and change the original shape...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think it's going to be possible to do this before the toQuery method. I can copy the shape but these shapes can be big and complex so I'd only want to do that if we need to. I guess one side effect of doing this here is that two QueryBuilders which are identical before the toQuery method is called (pass hashCode and Equals checks) would then not be equal after calling toQuery on only one of them. So actually maybe we should make a copy here? I'm torn

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.

I am thinking it is not worth it. Hopefully it won't cause problems to our test infra as we don't check the object after calling toQuery...... should we have done it in the first place? :)

@javanna
Copy link
Copy Markdown
Contributor

javanna commented Sep 10, 2015

left a few minor comments, looks good already though

@colings86
Copy link
Copy Markdown
Contributor Author

@javanna I pushed a commit to address your comments

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 just call this(fieldName, new ArrayList()); instead?

@s1monw
Copy link
Copy Markdown
Contributor

s1monw commented Sep 10, 2015

left some minors - looks great

@colings86
Copy link
Copy Markdown
Contributor Author

@s1monw thanks for the review. I've push a new commit that should address all your comments

@colings86 colings86 changed the title Query Refactoring: Refactor of GeoPolygonQuery Refactor of GeoPolygonQuery Sep 10, 2015
@s1monw
Copy link
Copy Markdown
Contributor

s1monw commented Sep 10, 2015

LGTM

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll make a new change to use this once that PR has been pushed

Moving the query building functionality from the parser to the builders
new toQuery() method analogous to other recent query refactorings.

Relates to #10217

PR goes against the query-refactoring branch
@colings86 colings86 merged commit cac72c9 into elastic:feature/query-refactoring Sep 11, 2015
@colings86 colings86 deleted the refactor/geo-polygon-query branch September 11, 2015 06:54
@clintongormley clintongormley added :Search/Search Search-related issues that do not fall into other categories and removed :Query Refactoring labels Feb 14, 2018
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.

5 participants