diegoceccarelli commented on a change in pull request #300: SOLR-11831: Skip 
second grouping step if group.limit is 1 (aka Las Vegas Patch)
URL: https://github.com/apache/lucene-solr/pull/300#discussion_r328272478
 
 

 ##########
 File path: 
lucene/grouping/src/java/org/apache/lucene/search/grouping/FirstPassGroupingCollector.java
 ##########
 @@ -139,10 +139,18 @@ public ScoreMode scoreMode() {
       // System.out.println("  group=" + (group.groupValue == null ? "null" : 
group.groupValue.toString()));
       SearchGroup<T> searchGroup = new SearchGroup<>();
       searchGroup.groupValue = group.groupValue;
+      // We pass this around so that we can get the corresponding solr id when 
serializing the search group to send to the federator
+      searchGroup.topDocLuceneId = group.topDoc;
       searchGroup.sortValues = new Object[sortFieldCount];
       for(int sortFieldIDX=0;sortFieldIDX<sortFieldCount;sortFieldIDX++) {
         searchGroup.sortValues[sortFieldIDX] = 
comparators[sortFieldIDX].value(group.comparatorSlot);
       }
+      // TODO: It should be possible to extend this to handle more than one 
FieldComparator and other types
 
 Review comment:
   I fixed the TODO - `topDocScore` seems to be used only to add the `maxScore` 
in the response - and I added tests that check that in distribute mode the 
values are the same with or without the skipping the second step.  
   
   sort by function and document about that will be tacked in a separate 
comment. 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to