Apache Lucene open-source search software
LUCENE-7384: Tweak SpanWeight.buildSimWeight to reuse the existing similarity.
David Smiley180f9562aa9c
diff --git a/lucene/core/src/java/org/apache/lucene/search/spans/SpanWeight.java b/lucene/core/src/java/org/apache/lucene/search/spans/SpanWeight.javaindex c0b231ecf03..4d081722899 100644--- a/lucene/core/src/java/org/apache/lucene/search/spans/SpanWeight.java+++ b/lucene/core/src/java/org/apache/lucene/search/spans/SpanWeight.java@@ -99,7 +99,7 @@ public abstract class SpanWeight extends Weight {i++;}CollectionStatistics collectionStats = searcher.collectionStatistics(query.getField());- return searcher.getSimilarity(true).computeWeight(boost, collectionStats, termStats);+ return similarity.computeWeight(boost, collectionStats, termStats);}/**