diff --git a/lucene/misc/src/java/org/apache/lucene/search/similarity/LegacyBM25Similarity.java b/lucene/misc/src/java/org/apache/lucene/search/similarity/LegacyBM25Similarity.java index 58091a7c972..300c1c04f9c 100644 --- a/lucene/misc/src/java/org/apache/lucene/search/similarity/LegacyBM25Similarity.java +++ b/lucene/misc/src/java/org/apache/lucene/search/similarity/LegacyBM25Similarity.java @@ -89,6 +89,14 @@ public final class LegacyBM25Similarity extends Similarity { bm25Similarity.setDiscountOverlaps(v); } + /** + * Returns true if overlap tokens are discounted from the document's length. + * @see #setDiscountOverlaps + */ + public boolean getDiscountOverlaps() { + return bm25Similarity.getDiscountOverlaps(); + } + @Override public String toString() { return bm25Similarity.toString();