From ef59ce971c8cbffff7113b8c165aa05ab46412b1 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Sat, 27 Jun 2009 11:14:42 +0000 Subject: [PATCH] LUCENE-1630: additional test case git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@788954 13f79535-47bb-0310-9956-ffa450edef68 --- src/test/org/apache/lucene/search/TestBooleanQuery.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/org/apache/lucene/search/TestBooleanQuery.java b/src/test/org/apache/lucene/search/TestBooleanQuery.java index e452a75af1f..da893db11ee 100644 --- a/src/test/org/apache/lucene/search/TestBooleanQuery.java +++ b/src/test/org/apache/lucene/search/TestBooleanQuery.java @@ -74,6 +74,14 @@ public class TestBooleanQuery extends LuceneTestCase { q.add(pq, BooleanClause.Occur.SHOULD); assertEquals(1, s.search(q, 10).totalHits); + // A required clause which returns null scorer should return null scorer to + // IndexSearcher. + q = new BooleanQuery(); + pq = new PhraseQuery(); + q.add(new TermQuery(new Term("field", "a")), BooleanClause.Occur.SHOULD); + q.add(pq, BooleanClause.Occur.MUST); + assertEquals(0, s.search(q, 10).totalHits); + DisjunctionMaxQuery dmq = new DisjunctionMaxQuery(1.0f); dmq.add(new TermQuery(new Term("field", "a"))); dmq.add(pq);