You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ji...@apache.org on 2019/03/12 08:33:55 UTC

[lucene-solr] branch master updated: LUCENE-8652: ensure that the norm doesn't influence the score in TestSynonymQuery#testBoosts

This is an automated email from the ASF dual-hosted git repository.

jimczi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/master by this push:
     new c87e761  LUCENE-8652: ensure that the norm doesn't influence the score in TestSynonymQuery#testBoosts
c87e761 is described below

commit c87e7614f1634d721e8328ef9c2f49ab7be911e6
Author: jimczi <ji...@apache.org>
AuthorDate: Tue Mar 12 09:33:40 2019 +0100

    LUCENE-8652: ensure that the norm doesn't influence the score in TestSynonymQuery#testBoosts
---
 .../core/src/test/org/apache/lucene/search/TestSynonymQuery.java | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSynonymQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestSynonymQuery.java
index b814e4a..36ec646 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSynonymQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSynonymQuery.java
@@ -37,6 +37,7 @@ import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.BooleanClause.Occur;
+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;
@@ -168,20 +169,20 @@ public class TestSynonymQuery extends LuceneTestCase {
     w.addDocument(doc);
     for (int i = 0; i < 10; ++i) {
       doc.clear();
-      doc.add(new TextField("f", "a a a a", Store.NO));
+      doc.add(new Field("f", "a a a a", ft));
       w.addDocument(doc);
       if (i % 2 == 0) {
         doc.clear();
-        doc.add(new TextField("f", "b b", Store.NO));
+        doc.add(new Field("f", "b b", ft));
         w.addDocument(doc);
       } else {
         doc.clear();
-        doc.add(new TextField("f", "a a b", Store.NO));
+        doc.add(new Field("f", "a a b", ft));
         w.addDocument(doc);
       }
     }
     doc.clear();
-    doc.add(new TextField("f", "c", Store.NO));
+    doc.add(new Field("f", "c", ft));
     w.addDocument(doc);
     IndexReader reader = w.getReader();
     IndexSearcher searcher = newSearcher(reader);