From 8466cc77baf12f53bc0e00bb3c88b11339140105 Mon Sep 17 00:00:00 2001 From: Mike McCandless Date: Sat, 12 Nov 2016 10:43:45 -0500 Subject: [PATCH] LUCENE-7557: use BM25Similarity for this test --- .../lucene/search/grouping/GroupingSearchTest.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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..1a1e8af7ed8 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 @@ -16,6 +16,10 @@ */ package org.apache.lucene.search.grouping; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -31,15 +35,12 @@ 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; import org.apache.lucene.util.mutable.MutableValueStr; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - public class GroupingSearchTest extends LuceneTestCase { // Tests some very basic usages... @@ -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;