mirror of https://github.com/apache/lucene.git
LUCENE-7555: use BM25Similarity for this test
This commit is contained in:
parent
4d9451034d
commit
2bc1d2761f
|
@ -50,10 +50,11 @@ import org.apache.lucene.search.Sort;
|
||||||
import org.apache.lucene.search.SortField;
|
import org.apache.lucene.search.SortField;
|
||||||
import org.apache.lucene.search.TermQuery;
|
import org.apache.lucene.search.TermQuery;
|
||||||
import org.apache.lucene.search.TopDocs;
|
import org.apache.lucene.search.TopDocs;
|
||||||
|
import org.apache.lucene.search.similarities.BM25Similarity;
|
||||||
import org.apache.lucene.store.Directory;
|
import org.apache.lucene.store.Directory;
|
||||||
import org.apache.solr.uninverting.UninvertingReader.Type;
|
|
||||||
import org.apache.lucene.util.LuceneTestCase;
|
import org.apache.lucene.util.LuceneTestCase;
|
||||||
import org.apache.lucene.util.TestUtil;
|
import org.apache.lucene.util.TestUtil;
|
||||||
|
import org.apache.solr.uninverting.UninvertingReader.Type;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Tests sorting (but with fieldcache instead of docvalues)
|
* Tests sorting (but with fieldcache instead of docvalues)
|
||||||
|
@ -434,6 +435,7 @@ public class TestFieldCacheSort extends LuceneTestCase {
|
||||||
writer.close();
|
writer.close();
|
||||||
|
|
||||||
IndexSearcher searcher = newSearcher(ir);
|
IndexSearcher searcher = newSearcher(ir);
|
||||||
|
searcher.setSimilarity(new BM25Similarity());
|
||||||
Sort sort = new Sort(new SortField(null, SortField.Type.SCORE, true));
|
Sort sort = new Sort(new SortField(null, SortField.Type.SCORE, true));
|
||||||
|
|
||||||
TopDocs actual = searcher.search(new TermQuery(new Term("value", "foo")), 10, sort);
|
TopDocs actual = searcher.search(new TermQuery(new Term("value", "foo")), 10, sort);
|
||||||
|
|
Loading…
Reference in New Issue