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/11/15 01:55:57 UTC

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

Author: yonik
Date: Mon Nov 15 00:55:57 2010
New Revision: 1035115

URL: http://svn.apache.org/viewvc?rev=1035115&view=rev
Log:
SOLR-236: grouping - fix collectors when sort != group.sort

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=1035115&r1=1035114&r2=1035115&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 Mon Nov 15 00:55:57 2010
@@ -679,16 +679,16 @@ class TopGroupSortCollector extends TopG
         buildSet();
       }
 
-      SearchGroup leastSignificantGroup = orderedGroups.last();
+      // see if this new group would be competitive if this doc was the top doc
       for (int i = 0;; i++) {
-        final int c = leastSignificantGroup.sortGroupReversed[i] * leastSignificantGroup.sortGroupComparators[i].compareBottom(doc);
+        final int c = reversed[i] * comparators[i].compareBottom(doc);
         if (c < 0) {
-          // Definitely not competitive.
+          // Definitely not competitive. So don't even bother to continue
           return;
         } else if (c > 0) {
           // Definitely competitive.
           break;
-        } else if (i == leastSignificantGroup.sortGroupComparators.length - 1) {
+        } else if (i == comparators.length - 1) {
           // Here c=0. If we're at the last comparator, this doc is not
           // competitive, since docs are visited in doc Id order, which means
           // this doc cannot compete with any other document in the queue.