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



##########
File path: solr/CHANGES.txt
##########
@@ -75,6 +75,9 @@ Improvements
 * SOLR-15011: /admin/logging handler will now propagate setLevel (log 
threshold) to all nodes
 when told to. The admin UI now tells it to. (Nazerke Seidan, David Smiley)
 
+* SOLR-15038: Add elevateDocsWithoutMatchingQ and onlyElevatedRepresentative 
parameters to elevation functionality.

Review comment:
       This needs to be updated after recent changes.

##########
File path: 
solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java
##########
@@ -653,12 +662,14 @@ public void collect(int contextDoc) throws IOException {
           ord = -1;
         }
       }
-      
-      // Check to see if we have documents boosted by the 
QueryElevationComponent
-      if (0 <= ord) {
-        if (boostedDocsCollector.collectIfBoosted(ord, globalDoc)) return;
-      } else {
-        if (boostedDocsCollector.collectInNullGroupIfBoosted(globalDoc)) 
return;
+
+      if(collectElevatedDocsWhenCollapsing) {

Review comment:
       Space after "if". Same remark for several added "if" blocks.

##########
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 elevateDocsWithoutMatchingQ = 
params.getBool(QueryElevationParams.ELEVATE_ONLY_DOCS_MATCHING_QUERY, false) ?

Review comment:
       What about a name like "queryOccurrence"?

##########
File path: 
solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java
##########
@@ -146,6 +146,12 @@ field collapsing (with ngroups) when the number of 
distinct groups
    */
   public static final String HINT_BLOCK = "block";
 
+  /**
+   * If elevation is used in combination with the collapse query parser, we 
can define that we only want to return the
+   * representative and not all elevated docs.

Review comment:
       Maybe complete the description with "by setting this parameter to false 
(true by default)."

##########
File path: solr/solr-ref-guide/src/the-query-elevation-component.adoc
##########
@@ -93,6 +93,14 @@ they be subject to whatever the sort criteria is?  True by 
default.
 This is also a request parameter, which will override the config.
 The effect is most apparent when forceElevation is true and there is sorting 
on fields.
 
+`elevateOnlyDocsMatchingQuery`::
+By default, the component will also elevate docs that aren't part of the 
search result (matching the query).
+If you only want to elevate the docs that are part of the search result, set 
this to `true` (default is `false`).
+
+`collectElevatedDocsWhenCollapsing`::

Review comment:
       Shouldn't this be moved to the Collapsing Query Parser section instead?




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