Package it.unimi.di.big.mg4j.search.score

Classes for assigning scores to documents.

A 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 nextInt() and 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 IntIterator's 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, LinearAggregator.

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.