mirror of https://github.com/apache/lucene.git
LUCENE-7557: use BM25Similarity for this test
This commit is contained in:
parent
fb4abd605d
commit
8466cc77ba
|
@ -16,6 +16,10 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.lucene.search.grouping;
|
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.analysis.MockAnalyzer;
|
||||||
import org.apache.lucene.document.Document;
|
import org.apache.lucene.document.Document;
|
||||||
import org.apache.lucene.document.Field;
|
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.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;
|
||||||
import org.apache.lucene.util.mutable.MutableValueStr;
|
import org.apache.lucene.util.mutable.MutableValueStr;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class GroupingSearchTest extends LuceneTestCase {
|
public class GroupingSearchTest extends LuceneTestCase {
|
||||||
|
|
||||||
// Tests some very basic usages...
|
// Tests some very basic usages...
|
||||||
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue