jtibshirani commented on a change in pull request #1709:
URL: https://github.com/apache/lucene-solr/pull/1709#discussion_r464554625
##########
File path:
lucene/core/src/test/org/apache/lucene/search/TestBooleanRewrites.java
##########
@@ -312,12 +312,20 @@ public void testRemoveMatchAllFilter() throws IOException
{
.add(new TermQuery(new Term("foo", "baz")), Occur.MUST)
.add(new MatchAllDocsQuery(), Occur.FILTER)
.build();
- BooleanQuery expected = new BooleanQuery.Builder()
+ Query expected = new BooleanQuery.Builder()
.setMinimumNumberShouldMatch(bq.getMinimumNumberShouldMatch())
.add(new TermQuery(new Term("foo", "bar")), Occur.MUST)
.add(new TermQuery(new Term("foo", "baz")), Occur.MUST)
.build();
assertEquals(expected, searcher.rewrite(bq));
+
+ bq = new BooleanQuery.Builder()
+ .add(new TermQuery(new Term("foo", "bar")), Occur.FILTER)
+ .add(new MatchAllDocsQuery(), Occur.FILTER)
+ .build();
+ expected = new BoostQuery(new ConstantScoreQuery(
+ new TermQuery(new Term("foo", "bar"))), 0.0f);
+ assertEquals(expected, searcher.rewrite(bq));
Review comment:
👍
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]