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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]