Package org.apache.lucene.search
Interface VectorScorer
public interface VectorScorer
Computes the similarity score between a given query vector and different document vectors. This
is used for exact searching and scoring
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBulk scorer interface to score multiple vectors at once -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault VectorScorer.Bulkbulk(DocIdSetIterator matchingDocs) An optional bulk scorer implementation that allows bulk scoring over the provided matching docs.iterator()floatscore()Compute the score for the current document ID.
-
Field Details
-
DEFAULT_BULK_BATCH_SIZE
static final int DEFAULT_BULK_BATCH_SIZE- See Also:
-
-
Method Details
-
score
Compute the score for the current document ID.- Returns:
- the score for the current document ID
- Throws:
IOException- if an exception occurs during score computation
-
iterator
DocIdSetIterator iterator()- Returns:
- a
DocIdSetIteratorover the documents.
-
bulk
An optional bulk scorer implementation that allows bulk scoring over the provided matching docs. The iterator of this instance of VectorScorer should be used and iterated in conjunction with the provided matchingDocs iterator to score only the documents that are present in both iterators. If the provided matchingDocs iterator is null, then all documents should be scored. Additionally, if the iterators are unpositioned (docID() == -1), this method should position them to the first document.- Parameters:
matchingDocs- Optional filter to iterate over the documents to score- Returns:
- a
VectorScorer.Bulkscorer - Throws:
IOException- if an exception occurs during bulk scorer creation- WARNING: This API is experimental and might change in incompatible ways in the next release.
-