lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbern...@apache.org
Subject [3/3] lucene-solr:branch_7x: SOLR-12795: Require bucketSorts
Date Wed, 07 Nov 2018 14:09:16 GMT
SOLR-12795: Require bucketSorts


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/19f4ebd2
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/19f4ebd2
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/19f4ebd2

Branch: refs/heads/branch_7x
Commit: 19f4ebd286264a0618a01c01d1ab430755bfd12e
Parents: b0064d1
Author: Joel Bernstein <jbernste@apache.org>
Authored: Wed Nov 7 08:58:57 2018 -0500
Committer: Joel Bernstein <jbernste@apache.org>
Committed: Wed Nov 7 09:05:48 2018 -0500

----------------------------------------------------------------------
 .../client/solrj/io/stream/FacetStream.java     |  2 +-
 .../stream/StreamExpressionToExpessionTest.java | 28 --------------------
 2 files changed, 1 insertion(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/19f4ebd2/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FacetStream.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FacetStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FacetStream.java
index 6923a3b..126df81 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FacetStream.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/FacetStream.java
@@ -163,7 +163,7 @@ public class FacetStream extends TupleStream implements Expressible  {
     String bucketSortString = null;
 
     if(bucketSortExpression == null) {
-      bucketSortString = "count(*) desc";
+      throw new IOException("The bucketSorts parameter is required for the facet function.");
     } else {
       bucketSortString = ((StreamExpressionValue)bucketSortExpression.getParameter()).getValue();
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/19f4ebd2/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpessionTest.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpessionTest.java
b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpessionTest.java
index 0b1c764..3dd4261 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpessionTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpessionTest.java
@@ -316,34 +316,6 @@ public class StreamExpressionToExpessionTest extends LuceneTestCase {
         +   "collection1, "
         +   "q=\"*:*\", "
         +   "buckets=\"a_s\", "
-        +   "bucketSizeLimit=100, "
-        +   "sum(a_i), sum(a_f), "
-        +   "min(a_i), min(a_f), "
-        +   "max(a_i), max(a_f), "
-        +   "avg(a_i), avg(a_f), "
-        +   "count(*)"
-        + ")"), factory)){
-      expressionString = stream.toExpression(factory).toString();
-      assertTrue(expressionString.contains("facet(collection1"));
-      assertTrue(expressionString.contains("q=\"*:*\""));
-      assertTrue(expressionString.contains("buckets=a_s"));
-      assertTrue(expressionString.contains("bucketSorts=\"count(*) desc\""));
-      assertTrue(expressionString.contains("bucketSizeLimit=100"));
-      assertTrue(expressionString.contains("sum(a_i)"));
-      assertTrue(expressionString.contains("sum(a_f)"));
-      assertTrue(expressionString.contains("min(a_i)"));
-      assertTrue(expressionString.contains("min(a_f)"));
-      assertTrue(expressionString.contains("max(a_i)"));
-      assertTrue(expressionString.contains("max(a_f)"));
-      assertTrue(expressionString.contains("avg(a_i,false)"));
-      assertTrue(expressionString.contains("avg(a_f,false)"));
-      assertTrue(expressionString.contains("count(*)"));
-    }
-
-    try (FacetStream stream = new FacetStream(StreamExpressionParser.parse("facet("
-        +   "collection1, "
-        +   "q=\"*:*\", "
-        +   "buckets=\"a_s\", "
         +   "bucketSorts=\"sum(a_i) asc\", "
         +   "rows=10, method=dvhash, "
         +   "sum(a_i), sum(a_f), "


Mime
View raw message