lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kris...@apache.org
Subject [03/16] lucene-solr:jira/solr-8593: LUCENE-7554: use BM25Similarity for this test
Date Mon, 14 Nov 2016 16:06:44 GMT
LUCENE-7554: use BM25Similarity for this test


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

Branch: refs/heads/jira/solr-8593
Commit: 672d7e013e9b4e7ab803cb68360d83654dcafe96
Parents: 7523d58
Author: Mike McCandless <mikemccand@apache.org>
Authored: Sat Nov 12 13:32:48 2016 -0500
Committer: Mike McCandless <mikemccand@apache.org>
Committed: Sat Nov 12 13:32:48 2016 -0500

----------------------------------------------------------------------
 .../lucene/search/vectorhighlight/FastVectorHighlighterTest.java   | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/672d7e01/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/FastVectorHighlighterTest.java
----------------------------------------------------------------------
diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/FastVectorHighlighterTest.java
b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/FastVectorHighlighterTest.java
index 89f46af..2658fe2 100644
--- a/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/FastVectorHighlighterTest.java
+++ b/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/FastVectorHighlighterTest.java
@@ -51,6 +51,7 @@ import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.search.highlight.DefaultEncoder;
 import org.apache.lucene.search.highlight.Encoder;
+import org.apache.lucene.search.similarities.BM25Similarity;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.automaton.CharacterRunAutomaton;
@@ -349,6 +350,7 @@ public class FastVectorHighlighterTest extends LuceneTestCase {
     FastVectorHighlighter highlighter = new FastVectorHighlighter();
     IndexReader reader = DirectoryReader.open(writer);
     IndexSearcher searcher = newSearcher(reader);
+    searcher.setSimilarity(new BM25Similarity());
     TopDocs hits = searcher.search(query, 10);
     assertEquals(2, hits.totalHits);
     FieldQuery fieldQuery  = highlighter.getFieldQuery(query, reader);


Mime
View raw message