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 2011/02/24 23:29:35 UTC

svn commit: r1074326 - in /lucene/dev/trunk/solr: CHANGES.txt src/java/org/apache/solr/handler/component/FacetComponent.java src/test/org/apache/solr/TestDistributedSearch.java

Author: yonik
Date: Thu Feb 24 22:29:35 2011
New Revision: 1074326

URL: http://svn.apache.org/viewvc?rev=1074326&view=rev
Log:
SOLR-2380 fix facet.limit for distrib faceting and facet.sort=index

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/src/java/org/apache/solr/handler/component/FacetComponent.java
    lucene/dev/trunk/solr/src/test/org/apache/solr/TestDistributedSearch.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1074326&r1=1074325&r2=1074326&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Thu Feb 24 22:29:35 2011
@@ -693,6 +693,10 @@ Bug Fixes
   useful error reporting when no match found (previously failed with a
   NullPointerException in log and no clear user feedback). (gthb via yonik)
 
+* SOLR-2380: Distributed faceting could miss values when facet.sort=index
+  and when facet.offset was greater than 0. (yonik)
+  
+
 
 Other Changes
 ----------------------

Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/handler/component/FacetComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/handler/component/FacetComponent.java?rev=1074326&r1=1074325&r2=1074326&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/handler/component/FacetComponent.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/handler/component/FacetComponent.java Thu Feb 24 22:29:35 2011
@@ -222,12 +222,11 @@ public class FacetComponent extends Sear
           sreq.params.remove(paramStart + FacetParams.FACET_MINCOUNT);
           sreq.params.remove(paramStart + FacetParams.FACET_OFFSET);
 
+          dff.initialLimit = dff.offset + dff.limit;
+
           if(dff.sort.equals(FacetParams.FACET_SORT_COUNT) && dff.limit > 0) {
             // set the initial limit higher to increase accuracy
-            dff.initialLimit = dff.offset + dff.limit;
             dff.initialLimit = (int)(dff.initialLimit * 1.5) + 10;
-          } else {
-            dff.initialLimit = dff.limit;
           }
 
           // Currently this is for testing only and allows overriding of the

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/TestDistributedSearch.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/TestDistributedSearch.java?rev=1074326&r1=1074325&r2=1074326&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/TestDistributedSearch.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/TestDistributedSearch.java Thu Feb 24 22:29:35 2011
@@ -137,6 +137,7 @@ public class TestDistributedSearch exten
     query("q","*:*", "rows",100, "facet","true", "facet.field",t1, "facet.limit",-1, "facet.sort","count", "facet.mincount",2);
     query("q","*:*", "rows",100, "facet","true", "facet.field",t1, "facet.limit",-1, "facet.sort","index");
     query("q","*:*", "rows",100, "facet","true", "facet.field",t1, "facet.limit",-1, "facet.sort","index", "facet.mincount",2);
+    query("q","*:*", "rows",100, "facet","true", "facet.field",t1, "facet.offset",10, "facet.limit",1, "facet.sort","index");
     query("q","*:*", "rows",100, "facet","true", "facet.field",t1,"facet.limit",1);
     query("q","*:*", "rows",100, "facet","true", "facet.query","quick", "facet.query","all", "facet.query","*:*");
     query("q","*:*", "rows",100, "facet","true", "facet.field",t1, "facet.offset",1);