Skip to content
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

Merged
merged 2 commits into from Jun 18, 2015

Conversation

MaineC
Copy link

@MaineC MaineC commented Jun 16, 2015

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?

@@ -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))
Copy link
Member

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.

@cbuescher
Copy link
Member

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

Isabel Drost-Fromm added 2 commits June 17, 2015 10:49
As per discussion in elastic#11274 this adds support for query boosting
to the SimpleQueryStringQuery.
@MaineC MaineC force-pushed the feature/simple-query-string-addboost branch from e8f28f7 to 5e9106a Compare June 17, 2015 09:19
@MaineC MaineC added the review label Jun 17, 2015
@MaineC MaineC self-assigned this Jun 17, 2015
@MaineC
Copy link
Author

MaineC commented Jun 18, 2015

Updated and ready for another round.

@javanna
Copy link
Member

javanna commented Jun 18, 2015

LGTM

MaineC pushed a commit that referenced this pull request Jun 18, 2015
…boost

Add support for query boost to SimpleQueryStringBuilder.

Relates to #10217
@MaineC MaineC merged commit 2fa5689 into elastic:master Jun 18, 2015
@MaineC MaineC removed the review label Jun 18, 2015
@clintongormley clintongormley added :Search/Search Search-related issues that do not fall into other categories and removed :Query DSL labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants