-
Notifications
You must be signed in to change notification settings - Fork 25.4k
Refactors TemplateQueryBuilder and Parser #13253
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
Refactors TemplateQueryBuilder and Parser #13253
Conversation
|
||
private ScriptService.ScriptType templateType; |
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.
+1 on removing these as essentially they are encapsulated in the Template above.
Left some minor comments. Looks pretty good to me already. |
@MaineC thanks for the review. I have addressed the comments. |
@@ -35,14 +42,8 @@ | |||
|
|||
/** Template to fill. */ | |||
private Template template; |
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.
template could be made final I think
left a few comments, looks good though! |
db005cf
to
9461fb1
Compare
if (!templateBase.equals(EmptyQueryBuilder.PROTOTYPE)) { | ||
assertEquals(templateBase.toQuery(createShardContext()).getClass().getName(), query.getClass().getName()); | ||
} | ||
} |
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.
I checked out the branch, testToQuery
fails consistently. You have to override setFinalBoost
in TemplateQueryBuilder
and make it a no-op like we did in WrapperQueryBuilder
. Also this conditional in doAssertLuceneQuery shouldn't be needed anymore. Replace with a simple equality check between query
and the result ot templateBase#toQuery
. The problems you previously encountered around boost should be solved now.
I did a final round of review, change looks good, there is a test problem though. LGTM once tests are fixed. |
Relates to elastic#10217 This PR is against the query-refactoring branch. Closes elastic#13253
9461fb1
to
c2ccb21
Compare
Relates to #10217
This PR is against the query-refactoring branch.