LUCENE-8010: GroupingSearchTest assumes longer fields = lower scores

This commit is contained in:
Alan Woodward 2018-01-02 11:06:45 +00:00
parent c1030eeb74
commit 6dd9dbf275
1 changed files with 2 additions and 0 deletions

View File

@ -31,6 +31,7 @@ import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query; import org.apache.lucene.search.Query;
import org.apache.lucene.search.Sort; import org.apache.lucene.search.Sort;
import org.apache.lucene.search.TermQuery; import org.apache.lucene.search.TermQuery;
import org.apache.lucene.search.similarities.BM25Similarity;
import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
@ -115,6 +116,7 @@ public class GroupingSearchTest extends LuceneTestCase {
w.addDocument(doc); w.addDocument(doc);
IndexSearcher indexSearcher = newSearcher(w.getReader()); IndexSearcher indexSearcher = newSearcher(w.getReader());
indexSearcher.setSimilarity(new BM25Similarity());
w.close(); w.close();
Sort groupSort = Sort.RELEVANCE; Sort groupSort = Sort.RELEVANCE;