LUCENE-1630: additional test case

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@788954 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2009-06-27 11:14:42 +00:00
parent 8a641eb4f7
commit ef59ce971c
1 changed files with 8 additions and 0 deletions

View File

@ -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);