Classes for assigning scores to documents.
Scorer is an
object that wraps an underlying
DocumentIterator and assigns scores to the documents
returned by the underlying iterator. In general, once a scorer has
wrapped a document iterator
one just calls
Scorer.score() to get scored documents (some iterators
might support index-restricted scoring,
but this is optional).
If the scorer is a
DelegatingScorer, then by contract
it just delegates all
methods to the underlying iterator.
In this case, it is possible to advance manually the underlying iterator and call
Scorer.score(). While this behaviour is useless for
general users, it is essential for aggregated scorers,
which combine several delegating scorers and provide services such as equalisation
and interval caching (in case more than one component scorer uses intervals). See, for instance,
Creating scorers from string descriptions
Scorers should provide, whenever possible, constructors accepting exclusively strings. Such constructors
makes it possible to create easily instances using the
ObjectParser conventions, so
that instances can be specified on a command line interface.
Class Summary Class Description AbstractAggregator AbstractScorerAn abstract implementation of
AbstractWeightedScorer BM25FScorerA scorer that implements the BM25F ranking scheme. BM25FScorer.Visitor BM25ScorerA scorer that implements the BM25 ranking scheme. ClarkeCormackScorerComputes the Clarke–Cormack score of all interval iterators of a document. ConstantScorerA scorer assigning a constant score (0 by default) to all documents. CountScorerA trivial scorer that computes the score by adding the counts (the number of occurrences within the current document) of each term multiplied by the weight of the relative index. DecreasingDocumentRankScorerCompute scores that do not depend on intervals, but that just assign a fixed score to each document starting from 1; scores are read from a file whose name is passed to the constructor. DocumentRankScorerCompute scores that do not depend on intervals, but that just assign a fixed score to each document; scores are read from a file whose name is passed to the constructor. DocumentScoreInfo<T>A container used to return scored results with additional information. LinearAggregatorAn aggregator that computes a linear combination of the component scorers. ScoredDocumentBoundedSizeQueue<T>A queue of scored documents with fixed maximum capacity. TfIdfScorerA scorer that implements the TF/IDF ranking formula. VignaScorerComputes the Vigna score of all interval iterators of a document.