Skip to content

Refactors CommonTermsQuery#11345

Closed
alexksikes wants to merge 5 commits intoelastic:feature/query-refactoringfrom
alexksikes:feature/query-refactoring-common-terms
Closed

Refactors CommonTermsQuery#11345
alexksikes wants to merge 5 commits intoelastic:feature/query-refactoringfrom
alexksikes:feature/query-refactoring-common-terms

Conversation

@alexksikes
Copy link
Copy Markdown
Contributor

Refactors CommonTermsQuery analogous to TermQueryBuilder. Still left to do are
the tests to compare between builder and actual Lucene query.

Relates to #10217

This PR is 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.

we can leave final fields (at least the mandatory ones) now that we implement Writeable instead of Streamable, then we can (almost) drop default constructors (see #11344 for more details)

@javanna
Copy link
Copy Markdown
Contributor

javanna commented May 26, 2015

I did a first round of review, left some comments

@alexksikes alexksikes force-pushed the feature/query-refactoring-common-terms branch from e86c0c5 to b85a191 Compare June 3, 2015 23:45
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.

oh boy this never worked through java api it seems, because disable_coords should have been disable_coord? if this is the case this same fix should be ported to master and probably 1.x too.

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.

Yes the query parser did not check on disable_coords unfortunately. I'll submit a fix to this.

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.

thanks that would be great, one less bug to fix here.

@javanna
Copy link
Copy Markdown
Contributor

javanna commented Jun 4, 2015

thanks @alexksikes I left some 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.

I think I'd leave this out of the enum, also would prefer a switch so that we have the OR case, the AND case, and we throw error otherwise (rather than doing AND and assume everything else is OR)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think having a method somehere to do the mapping to Occur is good, we might need this in other queries as well. Personally don't mind this beeing part of the enum type. Also covering the error case here may not be necessary, after all there are only two cases in the enum.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The mapping to occur is needed in the SimpleQueryStringBuilder as well - so might make sense to leave it here.

If implicitly we default to OR here (that's the default for the default operator* in SimpleQueryStringBuilder as well) we should do so in the serialisation methods as well, no?

.* too many defaults in one line...

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