Skip to content

Commit f47cd27

Browse files
authored
Deprecate BulkScorer#score(LeafReaderContext, Bits) (#13794)
We have removed BulkScorer#score(LeafReaderContext, Bits) in main in favour of BulkScorer#score(LeafCollector collector, Bits acceptDocs, int min, int max) as part of #13542. This commit deprecates the method in 9.x. Internal usages of it are left untouched as there may be subclasses that override it, which we don't want to break in a minor release.
1 parent e7b8ea0 commit f47cd27

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lucene/CHANGES.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ API Changes
3030
* GITHUB#13735: Add CollectorManager#forSequentialExecution to make CollectorManager creation more convenient
3131
for users of the deprecated IndexSearcher#search(Query, Collector). (Greg Miller)
3232

33+
* GITHUB#13794: Deprecate BulkScorer#score(LeafCollector collector, Bits acceptDocs) in favour of
34+
BulkScorer#score(LeafCollector collector, Bits acceptDocs, int min, int max). The method will be removed in the next
35+
major version. Replace usages with the latter, providing 0 as min and DocIdSetIterator.NO_MORE_DOCS as max in case
36+
the entire segment should be scored. Subclasses that override the method should instead override its replacement.
37+
(Luca Cavanna)
38+
3339
New Features
3440
---------------------
3541

lucene/core/src/java/org/apache/lucene/search/BulkScorer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ public abstract class BulkScorer {
3333
* @param collector The collector to which all matching documents are passed.
3434
* @param acceptDocs {@link Bits} that represents the allowed documents to match, or {@code null}
3535
* if they are all allowed to match.
36+
* @deprecated in favour of {@link #score(LeafCollector, Bits, int, int)}. Callers should instead
37+
* call the method variant that takes min and max as arguments, providing 0 and {@link
38+
* DocIdSetIterator#NO_MORE_DOCS} to score the entire segment. Subclasses that override it
39+
* should instead override its replacement.
3640
*/
41+
@Deprecated
3742
public void score(LeafCollector collector, Bits acceptDocs) throws IOException {
3843
final int next = score(collector, acceptDocs, 0, DocIdSetIterator.NO_MORE_DOCS);
3944
assert next == DocIdSetIterator.NO_MORE_DOCS;

0 commit comments

Comments
 (0)