LUCENE-7557: use BM25Similarity for this test

This commit is contained in:
Mike McCandless 2016-11-12 10:43:45 -05:00
parent a209c4e8c2
commit b0c43d5fd8
1 changed files with 6 additions and 4 deletions

View File

@ -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;