mirror of https://github.com/apache/lucene.git
make sure the simple tests run against both cases
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1459155 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
734c426fa7
commit
865982dbe3
|
@ -86,12 +86,22 @@ public class TestBooleanMinShouldMatch extends LuceneTestCase {
|
||||||
|
|
||||||
|
|
||||||
public void verifyNrHits(Query q, int expected) throws Exception {
|
public void verifyNrHits(Query q, int expected) throws Exception {
|
||||||
|
// bs1
|
||||||
ScoreDoc[] h = s.search(q, null, 1000).scoreDocs;
|
ScoreDoc[] h = s.search(q, null, 1000).scoreDocs;
|
||||||
if (expected != h.length) {
|
if (expected != h.length) {
|
||||||
printHits(getTestName(), h, s);
|
printHits(getTestName(), h, s);
|
||||||
}
|
}
|
||||||
assertEquals("result count", expected, h.length);
|
assertEquals("result count", expected, h.length);
|
||||||
//System.out.println("TEST: now check");
|
//System.out.println("TEST: now check");
|
||||||
|
// bs2
|
||||||
|
TopScoreDocCollector collector = TopScoreDocCollector.create(1000, true);
|
||||||
|
s.search(q, collector);
|
||||||
|
ScoreDoc[] h2 = collector.topDocs().scoreDocs;
|
||||||
|
if (expected != h2.length) {
|
||||||
|
printHits(getTestName(), h2, s);
|
||||||
|
}
|
||||||
|
assertEquals("result count (bs2)", expected, h2.length);
|
||||||
|
|
||||||
QueryUtils.check(random(), q,s);
|
QueryUtils.check(random(), q,s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue