LUCENE-9898 Remove no longer used scorePayload method from BM25Similarity (#57)

This commit is contained in:
Pieter van Boxtel 2021-04-01 02:06:03 +02:00 committed by GitHub
parent 79fcd99f4c
commit 1d579b9448
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 24 deletions

View File

@ -205,13 +205,16 @@ Improvements
* LUCENE-9827: Speed up merging of stored fields and term vectors for smaller segments.
(Daniel Mitterdorfer, Dimitrios Liapis, Adrien Grand, Robert Muir)
* LUCENE-9898: Removes no longer used scorePayload method from BM25Similarity
(Pieter van Boxtel)
Bug fixes
* LUCENE-9686: Fix read past EOF handling in DirectIODirectory. (Zach Chen,
* LUCENE-9686: Fix read past EOF handling in DirectIODirectory. (Zach Chen,
Julie Tibshirani)
* LUCENE-8663: NRTCachingDirectory.slowFileExists may open a file while
* LUCENE-8663: NRTCachingDirectory.slowFileExists may open a file while
it's inaccessible. (Dawid Weiss)
* LUCENE-9117: RamUsageEstimator hangs with AOT compilation. Removed any attempt to
@ -226,7 +229,7 @@ Bug fixes
* LUCENE-9365: FuzzyQuery was missing matches when prefix length was equal to the term length
(Mark Harwood, Mike Drob)
* LUCENE-9580: Fix bug in the polygon tessellator when introducing collinear edges during polygon
* LUCENE-9580: Fix bug in the polygon tessellator when introducing collinear edges during polygon
splitting. (Ignacio Vera)
Changes in Backwards Compatibility Policy
@ -235,8 +238,8 @@ Changes in Backwards Compatibility Policy
older than N-1. Lucene now can open indices created with a major version of N-2 in read-only mode.
Opening an index created with a major version of N-2 with an IndexWriter is not supported.
Further does lucene only support file-format compatibilty which enables reading of old indices while
semantic changes like analysis or certain encoding on top of the file format are only supported on
a best effort basis. (Simon Willnauer)
semantic changes like analysis or certain encoding on top of the file format are only supported on
a best effort basis. (Simon Willnauer)
Other
@ -289,16 +292,16 @@ API Changes
New Features
---------------------
* LUCENE-9537: Added smoothingScore method and default implementation to
Scorable abstract class. The smoothing score allows scorers to calculate a
score for a document where the search term or subquery is not present. The
smoothing score acts like an idf so that documents that do not have terms or
subqueries that are more frequent in the index are not penalized as much as
documents that do not have less frequent terms or subqueries and prevents
scores which are the product or terms or subqueries from going to zero. Added
the implementation of the Indri AND and the IndriDirichletSimilarity from the
academic Indri search engine: http://www.lemurproject.org/indri.php.
(Cameron VandenBerg)
* LUCENE-9537: Added smoothingScore method and default implementation to
Scorable abstract class. The smoothing score allows scorers to calculate a
score for a document where the search term or subquery is not present. The
smoothing score acts like an idf so that documents that do not have terms or
subqueries that are more frequent in the index are not penalized as much as
documents that do not have less frequent terms or subqueries and prevents
scores which are the product or terms or subqueries from going to zero. Added
the implementation of the Indri AND and the IndriDirichletSimilarity from the
academic Indri search engine: http://www.lemurproject.org/indri.php.
(Cameron VandenBerg)
* LUCENE-9694: New tool for creating a deterministic index to enable benchmarking changes
on a consistent multi-segment index even when they require re-indexing. (Haoyu Zhai)
@ -357,7 +360,7 @@ Bug Fixes
---------------------
* LUCENE-9870: Fix Circle2D intersectsLine t-value (distance) range clamp (Jørgen Nystad)
======================= Lucene 8.8.1 =======================
Bug Fixes
@ -375,9 +378,9 @@ New Features
the generated synonyms to copy some or all flags from the original token (Gus Heck).
* LUCENE-9552: New LatLonPoint query that accepts an array of LatLonGeometries. (Ignacio Vera)
* LUCENE-9552: New LatLonPoint query that accepts an array of LatLonGeometries. (Ignacio Vera)
* LUCENE-9641: LatLonPoint query support for spatial relationships. (Ignacio Vera)
* LUCENE-9641: LatLonPoint query support for spatial relationships. (Ignacio Vera)
* LUCENE-9553: New XYPoint query that accepts an array of XYGeometries. (Ignacio Vera)

View File

@ -23,7 +23,6 @@ import org.apache.lucene.index.IndexOptions;
import org.apache.lucene.search.CollectionStatistics;
import org.apache.lucene.search.Explanation;
import org.apache.lucene.search.TermStatistics;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.SmallFloat;
/**
@ -106,11 +105,6 @@ public class BM25Similarity extends Similarity {
return (float) Math.log(1 + (docCount - docFreq + 0.5D) / (docFreq + 0.5D));
}
/** The default implementation returns <code>1</code> */
protected float scorePayload(int doc, int start, int end, BytesRef payload) {
return 1;
}
/** The default implementation computes the average as <code>sumTotalTermFreq / docCount</code> */
protected float avgFieldLength(CollectionStatistics collectionStats) {
return (float) (collectionStats.sumTotalTermFreq() / (double) collectionStats.docCount());