Skip to content

Conversation

alexksikes
Copy link
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
Member

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
Member

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
Member

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
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
Member

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
Member

javanna commented Jun 4, 2015

thanks @alexksikes I left some comments

Copy link
Member

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
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

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...

Copy link
Member

Choose a reason for hiding this comment

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

what happens if we set this when the Operator is AND? maybe we should test that scenario too?

@javanna
Copy link
Member

javanna commented Jun 19, 2015

I did a last round of review, you can rebase, it would be good to have #11730 fixed upstream though before merging this I think.

@alexksikes alexksikes force-pushed the feature/query-refactoring-common-terms branch from 8618300 to 537f24a Compare June 19, 2015 20:57
Copy link
Member

Choose a reason for hiding this comment

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

if you have rebased, this one should appear like a new method right?

@javanna
Copy link
Member

javanna commented Jun 22, 2015

left a couple of minor comments, this is very close

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

Relates to elastic#10217

This PR is against the query-refactoring branch.
@alexksikes alexksikes force-pushed the feature/query-refactoring-common-terms branch from 537f24a to 494a468 Compare June 22, 2015 17:08
Copy link
Member

Choose a reason for hiding this comment

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

can you add @OverRide here?

@javanna
Copy link
Member

javanna commented Jun 23, 2015

LGTM besides the few cosmetic comments I left

@javanna
Copy link
Member

javanna commented Jun 23, 2015

LGTM

@alexksikes alexksikes closed this Jun 23, 2015
@kevinkluge kevinkluge removed the review label Jun 23, 2015
@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.

6 participants