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
Add support for query boost to SimpleQueryStringBuilder. #11696
Add support for query boost to SimpleQueryStringBuilder. #11696
Conversation
@@ -60,6 +61,13 @@ public void testSimpleQueryString() throws ExecutionException, InterruptedExcept | |||
assertSearchHits(searchResponse, "1", "2", "3"); | |||
|
|||
searchResponse = client().prepareSearch().setQuery( | |||
boolQuery() | |||
.should(simpleQueryStringQuery("foo").boost(-10.0f)) |
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.
Small suggestion: maybe add some explanation or another test case that shows why its the negative boost that makes the difference in the first hit result. Makes reading the test a little easier.
LGTM besides the small suggestion on explaining the test case a bit more. |
@@ -38,6 +39,7 @@ | |||
private String queryName; | |||
private String minimumShouldMatch; | |||
private int flags = -1; | |||
private float boost = 1.0f; |
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 think we use -1 as default in master for all of the other queries, and we move to 1.0f in the query-refactoring branch. Should we use -1 here too for now?
As per discussion in elastic#11274 this adds support for query boosting to the SimpleQueryStringQuery.
e8f28f7
to
5e9106a
Compare
Updated and ready for another round. |
LGTM |
…boost Add support for query boost to SimpleQueryStringBuilder. Relates to #10217
As per discussion in #11274 this adds support for query boosting to the SimpleQueryStringQuery.
In the process of refactoring SimpleQueryStringQueryBuilder/-Parser we noticed that this is one of the few queries that doesn't support query level boosting, although it in theory it could. Adding this support here.
@dakrone @javanna @cbuescher can either of you check the PR please?