TestGrouping.testRandom() requires BM25Similarity

This commit is contained in:
Alan Woodward 2018-03-14 14:56:02 +00:00
parent 5e02c18769
commit 446d38474e
1 changed files with 6 additions and 0 deletions

View File

@ -755,6 +755,9 @@ public class TestGrouping extends LuceneTestCase {
Directory dirBlocks = null; Directory dirBlocks = null;
final IndexSearcher s = newSearcher(r); final IndexSearcher s = newSearcher(r);
// This test relies on the fact that longer fields produce lower scores
s.setSimilarity(new BM25Similarity());
if (VERBOSE) { if (VERBOSE) {
System.out.println("\nTEST: searcher=" + s); System.out.println("\nTEST: searcher=" + s);
} }
@ -790,6 +793,9 @@ public class TestGrouping extends LuceneTestCase {
final Query lastDocInBlock = new TermQuery(new Term("groupend", "x")); final Query lastDocInBlock = new TermQuery(new Term("groupend", "x"));
final IndexSearcher sBlocks = newSearcher(rBlocks); final IndexSearcher sBlocks = newSearcher(rBlocks);
// This test relies on the fact that longer fields produce lower scores
sBlocks.setSimilarity(new BM25Similarity());
final ShardState shardsBlocks = new ShardState(sBlocks); final ShardState shardsBlocks = new ShardState(sBlocks);
// ReaderBlocks only increases maxDoc() vs reader, which // ReaderBlocks only increases maxDoc() vs reader, which