From 6dd9dbf2758c1fad2f10f0eba96998411aa43fd0 Mon Sep 17 00:00:00 2001 From: Alan Woodward Date: Tue, 2 Jan 2018 11:06:45 +0000 Subject: [PATCH] LUCENE-8010: GroupingSearchTest assumes longer fields = lower scores --- .../org/apache/lucene/search/grouping/GroupingSearchTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupingSearchTest.java b/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupingSearchTest.java index d13bfd73e4b..d09513ca128 100644 --- a/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupingSearchTest.java +++ b/lucene/grouping/src/test/org/apache/lucene/search/grouping/GroupingSearchTest.java @@ -31,6 +31,7 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.Sort; import org.apache.lucene.search.TermQuery; +import org.apache.lucene.search.similarities.BM25Similarity; import org.apache.lucene.store.Directory; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.LuceneTestCase; @@ -115,6 +116,7 @@ public class GroupingSearchTest extends LuceneTestCase { w.addDocument(doc); IndexSearcher indexSearcher = newSearcher(w.getReader()); + indexSearcher.setSimilarity(new BM25Similarity()); w.close(); Sort groupSort = Sort.RELEVANCE;