mirror of https://github.com/apache/lucene.git
LUCENE-5489: fix test bug
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1579948 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9f7d52ca2e
commit
3d0875f80a
|
@ -23,6 +23,7 @@ import org.apache.lucene.index.IndexReader;
|
|||
import org.apache.lucene.index.RandomIndexWriter;
|
||||
import org.apache.lucene.index.Term;
|
||||
import org.apache.lucene.search.BooleanClause.Occur;
|
||||
import org.apache.lucene.search.similarities.DefaultSimilarity;
|
||||
import org.apache.lucene.search.spans.SpanNearQuery;
|
||||
import org.apache.lucene.search.spans.SpanQuery;
|
||||
import org.apache.lucene.search.spans.SpanTermQuery;
|
||||
|
@ -53,6 +54,9 @@ public class TestQueryRescorer extends LuceneTestCase {
|
|||
bq.add(new TermQuery(new Term("field", "oz")), Occur.SHOULD);
|
||||
IndexSearcher searcher = newSearcher(r);
|
||||
|
||||
// We rely on more tokens = lower score:
|
||||
searcher.setSimilarity(new DefaultSimilarity());
|
||||
|
||||
TopDocs hits = searcher.search(bq, 10);
|
||||
assertEquals(2, hits.totalHits);
|
||||
assertEquals("0", searcher.doc(hits.scoreDocs[0].doc).get("id"));
|
||||
|
|
Loading…
Reference in New Issue