You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by yo...@apache.org on 2010/10/29 16:42:34 UTC

svn commit: r1028777 - /lucene/dev/trunk/solr/src/java/org/apache/solr/search/Grouping.java

Author: yonik
Date: Fri Oct 29 14:42:33 2010
New Revision: 1028777

URL: http://svn.apache.org/viewvc?rev=1028777&view=rev
Log:
docs: expand short-circuit explanation

Modified:
    lucene/dev/trunk/solr/src/java/org/apache/solr/search/Grouping.java

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/search/Grouping.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/search/Grouping.java?rev=1028777&r1=1028776&r2=1028777&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/search/Grouping.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/search/Grouping.java Fri Oct 29 14:42:33 2010
@@ -177,6 +177,11 @@ class TopGroupCollector extends GroupCol
     // if orderedGroups != null, then we already have collected N groups and
     // can short circuit by comparing this document to the smallest group
     // without having to even find what group this document belongs to.
+    // Even if this document belongs to a group in the top N, we know that
+    // we don't have to update that group.
+    //
+    // Downside: if the number of unique groups is very low, this is
+    // wasted effort as we will most likely be updating an existing group.
     if (orderedGroups != null) {
       for (int i = 0;; i++) {
         final int c = reversed[i] * comparators[i].compareBottom(doc);