lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject svn commit: r1373605 - in /lucene/dev/branches/branch_4x/solr: ./ cloud-dev/ contrib/ core/ core/src/java/org/apache/solr/handler/component/ core/src/test/org/apache/solr/handler/component/ dev-tools/ example/ lib/ licenses/ scripts/ solrj/ test-framew...
Date Wed, 15 Aug 2012 19:56:12 GMT
Author: hossman
Date: Wed Aug 15 19:56:11 2012
New Revision: 1373605

URL: http://svn.apache.org/viewvc?rev=1373605&view=rev
Log:
SOLR-2981: Fixed StatsComponent to no longer return duplicated information when requesting
multiple stats.facet fields (merge r1373598)

Modified:
    lucene/dev/branches/branch_4x/solr/   (props changed)
    lucene/dev/branches/branch_4x/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_4x/solr/LICENSE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/README.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/build.xml   (props changed)
    lucene/dev/branches/branch_4x/solr/cloud-dev/   (props changed)
    lucene/dev/branches/branch_4x/solr/common-build.xml   (props changed)
    lucene/dev/branches/branch_4x/solr/contrib/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java
    lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/handler/component/StatsComponentTest.java
    lucene/dev/branches/branch_4x/solr/dev-tools/   (props changed)
    lucene/dev/branches/branch_4x/solr/example/   (props changed)
    lucene/dev/branches/branch_4x/solr/lib/   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpclient-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpclient-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpcore-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpcore-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpmime-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpmime-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/scripts/   (props changed)
    lucene/dev/branches/branch_4x/solr/solrj/   (props changed)
    lucene/dev/branches/branch_4x/solr/test-framework/   (props changed)
    lucene/dev/branches/branch_4x/solr/testlogging.properties   (props changed)
    lucene/dev/branches/branch_4x/solr/webapp/   (props changed)

Modified: lucene/dev/branches/branch_4x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/CHANGES.txt?rev=1373605&r1=1373604&r2=1373605&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_4x/solr/CHANGES.txt Wed Aug 15 19:56:11 2012
@@ -62,6 +62,10 @@ Bug Fixes
 * SOLR-3730: Rollback is not implemented quite right and can cause corner case fails in 
   SolrCloud tests. (rmuir, Mark Miller)
 
+* SOLR-2981: Fixed StatsComponent to no longer return duplicated information 
+  when requesting multiple stats.facet fields.
+  (Roman Kliewer via hossman)
+
 Other Changes
 ----------------------
 

Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java?rev=1373605&r1=1373604&r2=1373605&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java
(original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java
Wed Aug 15 19:56:11 2012
@@ -182,8 +182,8 @@ abstract class AbstractStatsValues<T> im
       for (Map.Entry<String, StatsValues> e2 : entry.getValue().entrySet()) {
         nl2.add(e2.getKey(), e2.getValue().getStatsValues());
       }
-      res.add(FACETS, nl);
     }
+    res.add(FACETS, nl);
     return res;
   }
 

Modified: lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/handler/component/StatsComponentTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/handler/component/StatsComponentTest.java?rev=1373605&r1=1373604&r2=1373605&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/handler/component/StatsComponentTest.java
(original)
+++ lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/handler/component/StatsComponentTest.java
Wed Aug 15 19:56:11 2012
@@ -228,32 +228,35 @@ public class StatsComponentTest extends 
   }
 
   public void doTestFacetStatisticsResult(String f) throws Exception {
-    assertU(adoc("id", "1", f, "10", "active_s", "true"));
-    assertU(adoc("id", "2", f, "20", "active_s", "true"));
-    assertU(adoc("id", "3", f, "30", "active_s", "false"));
-    assertU(adoc("id", "4", f, "40", "active_s", "false"));
+    assertU(adoc("id", "1", f, "10", "active_s", "true",  "other_s", "foo"));
+    assertU(adoc("id", "2", f, "20", "active_s", "true",  "other_s", "bar"));
+    assertU(adoc("id", "3", f, "30", "active_s", "false", "other_s", "foo"));
+    assertU(adoc("id", "4", f, "40", "active_s", "false", "other_s", "foo"));
     assertU(commit());
     
-    assertQ("test value for active_s=true", req("q","*:*", "stats","true", "stats.field",f,
"stats.facet","active_s","indent","true")
-            , "//lst[@name='true']/double[@name='min'][.='10.0']"
-            , "//lst[@name='true']/double[@name='max'][.='20.0']"
-            , "//lst[@name='true']/double[@name='sum'][.='30.0']"
-            , "//lst[@name='true']/long[@name='count'][.='2']"
-            , "//lst[@name='true']/long[@name='missing'][.='0']"
-            , "//lst[@name='true']/double[@name='sumOfSquares'][.='500.0']"
-            , "//lst[@name='true']/double[@name='mean'][.='15.0']"
-            , "//lst[@name='true']/double[@name='stddev'][.='7.0710678118654755']"
+    final String pre = "//lst[@name='stats_fields']/lst[@name='"+f+"']/lst[@name='facets']/lst[@name='active_s']";
+
+    assertQ("test value for active_s=true", req("q","*:*", "stats","true", "stats.field",f,
"stats.facet","active_s","stats.facet","other_s","indent","true")
+            , "*[count("+pre+")=1]"
+            , pre+"/lst[@name='true']/double[@name='min'][.='10.0']"
+            , pre+"/lst[@name='true']/double[@name='max'][.='20.0']"
+            , pre+"/lst[@name='true']/double[@name='sum'][.='30.0']"
+            , pre+"/lst[@name='true']/long[@name='count'][.='2']"
+            , pre+"/lst[@name='true']/long[@name='missing'][.='0']"
+            , pre+"/lst[@name='true']/double[@name='sumOfSquares'][.='500.0']"
+            , pre+"/lst[@name='true']/double[@name='mean'][.='15.0']"
+            , pre+"/lst[@name='true']/double[@name='stddev'][.='7.0710678118654755']"
     );
 
     assertQ("test value for active_s=false", req("q","*:*", "stats","true", "stats.field",f,
"stats.facet","active_s")
-            , "//lst[@name='false']/double[@name='min'][.='30.0']"
-            , "//lst[@name='false']/double[@name='max'][.='40.0']"
-            , "//lst[@name='false']/double[@name='sum'][.='70.0']"
-            , "//lst[@name='false']/long[@name='count'][.='2']"
-            , "//lst[@name='false']/long[@name='missing'][.='0']"
-            , "//lst[@name='false']/double[@name='sumOfSquares'][.='2500.0']"
-            , "//lst[@name='false']/double[@name='mean'][.='35.0']"
-            , "//lst[@name='false']/double[@name='stddev'][.='7.0710678118654755']"
+            , pre+"/lst[@name='false']/double[@name='min'][.='30.0']"
+            , pre+"/lst[@name='false']/double[@name='max'][.='40.0']"
+            , pre+"/lst[@name='false']/double[@name='sum'][.='70.0']"
+            , pre+"/lst[@name='false']/long[@name='count'][.='2']"
+            , pre+"/lst[@name='false']/long[@name='missing'][.='0']"
+            , pre+"/lst[@name='false']/double[@name='sumOfSquares'][.='2500.0']"
+            , pre+"/lst[@name='false']/double[@name='mean'][.='35.0']"
+            , pre+"/lst[@name='false']/double[@name='stddev'][.='7.0710678118654755']"
     );
   }
   



Mime
View raw message