bruno-roustant commented on a change in pull request #2134:
URL: https://github.com/apache/lucene-solr/pull/2134#discussion_r577477601



##########
File path: 
solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java
##########
@@ -509,7 +509,9 @@ private void setQuery(ResponseBuilder rb, Elevation 
elevation) {
       rb.setQuery(new BoostQuery(elevation.includeQuery, 0f));
     } else {
       BooleanQuery.Builder queryBuilder = new BooleanQuery.Builder();
-      queryBuilder.add(rb.getQuery(), BooleanClause.Occur.SHOULD);
+      BooleanClause.Occur queryOccurrence = 
params.getBool(QueryElevationParams.ELEVATE_ONLY_DOCS_MATCHING_QUERY, false) ?
+              BooleanClause.Occur.SHOULD : BooleanClause.Occur.MUST;

Review comment:
       @tkaessmann when I ran tests I saw this line has a bug. It inverts the 
SHOULD and MUST.
   Hopefully I fixed it and merged it without the bug.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to