Document that bulkScorer method can return null (#11897)

Like Weight#scorer, we should warn users that Weight#bulkScorer can 
return null if the query matches no documents.
This commit is contained in:
Nhat Nguyen 2022-11-02 15:12:43 -07:00 committed by GitHub
parent 4e207fed62
commit 1a5ad61b9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -158,7 +158,9 @@ public abstract class Weight implements SegmentCacheable {
*
* @param context the {@link org.apache.lucene.index.LeafReaderContext} for which to return the
* {@link Scorer}.
* @return a {@link BulkScorer} which scores documents and passes them to a collector.
* @return a {@link BulkScorer} which scores documents and passes them to a collector. Like {@link
* #scorer(LeafReaderContext)}, this method can return null if this query matches no
* documents.
* @throws IOException if there is a low-level I/O error
*/
public BulkScorer bulkScorer(LeafReaderContext context) throws IOException {