mirror of https://github.com/apache/lucene.git
LUCENE-7554: use BM25Similarity for this test
This commit is contained in:
parent
7523d580ed
commit
672d7e013e
|
@ -51,6 +51,7 @@ import org.apache.lucene.search.TermQuery;
|
|||
import org.apache.lucene.search.TopDocs;
|
||||
import org.apache.lucene.search.highlight.DefaultEncoder;
|
||||
import org.apache.lucene.search.highlight.Encoder;
|
||||
import org.apache.lucene.search.similarities.BM25Similarity;
|
||||
import org.apache.lucene.store.Directory;
|
||||
import org.apache.lucene.util.LuceneTestCase;
|
||||
import org.apache.lucene.util.automaton.CharacterRunAutomaton;
|
||||
|
@ -349,6 +350,7 @@ public class FastVectorHighlighterTest extends LuceneTestCase {
|
|||
FastVectorHighlighter highlighter = new FastVectorHighlighter();
|
||||
IndexReader reader = DirectoryReader.open(writer);
|
||||
IndexSearcher searcher = newSearcher(reader);
|
||||
searcher.setSimilarity(new BM25Similarity());
|
||||
TopDocs hits = searcher.search(query, 10);
|
||||
assertEquals(2, hits.totalHits);
|
||||
FieldQuery fieldQuery = highlighter.getFieldQuery(query, reader);
|
||||
|
|
Loading…
Reference in New Issue