lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject [14/18] lucene-solr:jira/solr-11702: LUCENE-8010: TestGrouping expects that longer fields produce lower scores.
Date Wed, 03 Jan 2018 10:52:02 GMT
LUCENE-8010: TestGrouping expects that longer fields produce lower scores.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/deb76449
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/deb76449
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/deb76449

Branch: refs/heads/jira/solr-11702
Commit: deb7644912f6339e0647795c732049af2e60fc75
Parents: 8dfb019
Author: Adrien Grand <jpountz@gmail.com>
Authored: Fri Dec 29 15:59:50 2017 +0100
Committer: Adrien Grand <jpountz@gmail.com>
Committed: Fri Dec 29 15:59:50 2017 +0100

----------------------------------------------------------------------
 .../src/test/org/apache/lucene/search/grouping/TestGrouping.java  | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/deb76449/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java
----------------------------------------------------------------------
diff --git a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java
b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java
index 9779c43..f59df53 100644
--- a/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java
+++ b/lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java
@@ -59,6 +59,7 @@ import org.apache.lucene.search.Sort;
 import org.apache.lucene.search.SortField;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.Weight;
+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;
@@ -135,6 +136,8 @@ public class TestGrouping extends LuceneTestCase {
     w.addDocument(doc);
 
     IndexSearcher indexSearcher = newSearcher(w.getReader());
+    // This test relies on the fact that longer fields produce lower scores
+    indexSearcher.setSimilarity(new BM25Similarity());
     w.close();
 
     final Sort groupSort = Sort.RELEVANCE;


Mime
View raw message