lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject [10/50] [abbrv] lucene-solr:apiv2: SOLR-9786: additional test related to TermInSetQuery now requiring all terms in same field
Date Tue, 24 Jan 2017 03:33:06 GMT
SOLR-9786: additional test related to TermInSetQuery now requiring all terms in same field


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

Branch: refs/heads/apiv2
Commit: 7d7e5d2246d69843f259b9815332a24dc621d9e7
Parents: 1acd2ee
Author: yonik <yonik@apache.org>
Authored: Tue Jan 17 10:20:02 2017 -0500
Committer: yonik <yonik@apache.org>
Committed: Tue Jan 17 10:20:02 2017 -0500

----------------------------------------------------------------------
 .../org/apache/solr/search/TestSolrQueryParser.java  | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7d7e5d22/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java b/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
index 76b441b..20c1907 100644
--- a/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
+++ b/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
@@ -259,6 +259,21 @@ public class TestSolrQueryParser extends SolrTestCaseJ4 {
     }
     assertEquals(26, ((TermInSetQuery)qq).getTermData().size());
 
+    // test terms queries of two different fields (LUCENE-7637 changed to require all terms
be in the same field)
+    StringBuilder sb = new StringBuilder();
+    for (int i=0; i<17; i++) {
+      char letter = (char)('a'+i);
+      sb.append("foo_s:" + letter + " bar_s:" + letter + " ");
+    }
+    qParser = QParser.getParser(sb.toString(), req);
+    qParser.setIsFilter(true); // this may change in the future
+    q = qParser.getQuery();
+    assertEquals(2, ((BooleanQuery)q).clauses().size());
+    for (BooleanClause clause : ((BooleanQuery)q).clauses()) {
+      qq = clause.getQuery();
+      assertEquals(17, ((TermInSetQuery)qq).getTermData().size());
+    }
+
     req.close();
   }
 


Mime
View raw message