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_r293828038
 
 

 ##########
 File path: 
solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
 ##########
 @@ -288,6 +328,13 @@ protected void prepareGrouping(ResponseBuilder rb) throws 
IOException {
     groupingSpec.setMain(params.getBool(GroupParams.GROUP_MAIN, false));
     groupingSpec.setNeedScore((rb.getFieldFlags() & 
SolrIndexSearcher.GET_SCORES) != 0);
     groupingSpec.setTruncateGroups(params.getBool(GroupParams.GROUP_TRUNCATE, 
false));
+
+    
groupingSpec.setSkipSecondGroupingStep(params.getBool(GroupParams.GROUP_SKIP_DISTRIBUTED_SECOND,
 false));
+    boolean isReranking = (rb.getRankQuery() != null);
+    if (groupingSpec.isSkipSecondGroupingStep() & 
!allowSkipSecondGroupingStep(groupingSpec.getWithinGroupSortSpec(), 
groupingSpec.getGroupSortSpec(), isReranking)){
 
 Review comment:
   I like it, but what about `validate` being `void` and throwing  a 
`SolrException` in case of problems? in this case we can return the description 
of the particular problem in the exception and we just call `validate` at the 
end of the setup. what do you think ?

----------------------------------------------------------------
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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to