You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by GitBox <gi...@apache.org> on 2019/07/15 12:15:34 UTC

[GitHub] [lucene-solr] jpountz commented on a change in pull request #784: LUCENE-8810: Honor MaxClausesCount in BooleanQuery During Flattening

jpountz commented on a change in pull request #784: LUCENE-8810: Honor MaxClausesCount in BooleanQuery During Flattening
URL: https://github.com/apache/lucene-solr/pull/784#discussion_r303404207
 
 

 ##########
 File path: lucene/core/src/test/org/apache/lucene/search/TestBooleanQuery.java
 ##########
 @@ -73,6 +73,21 @@ public void testEquality() throws Exception {
     assertEquals(bq1.build(), bq2.build());
   }
 
+  public void testFlattenInnerDisjunctionsWithMoreThan1024Terms() throws IOException {
+    IndexSearcher searcher = newSearcher(new MultiReader());
+
+    BooleanQuery.Builder builder1024 = new BooleanQuery.Builder();
+    for(int i = 0; i < 1024; i++) {
+      builder1024.add(new TermQuery(new Term("foo", "bar-" + i)), Occur.SHOULD);
+    }
+    Query inner = builder1024.build();
+    Query query = new BooleanQuery.Builder()
+        .add(inner, Occur.SHOULD)
+        .add(new TermQuery(new Term("foo", "baz")), Occur.SHOULD)
+        .build();
+    searcher.rewrite(query);
 
 Review comment:
   can you make it `assertSame(query, searcher.rewrite(query))`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org