| A
Scorer that aggregates a number of underlying
it.unimi.dsi.mg4j.search.score.DelegatingScorer delegating scorers , providing equalisation if required.
An aggregator combines the results of several scorers following some policy (see, e.g.,
it.unimi.dsi.mg4j.search.score.LinearAggregator ). In doing so, often the aggregator
needs to explore the first scores returned by each scorer, and tune some internal parameters. This
procedure, equalisation, is supported by this class: if
AbstractAggregator.equalize(int) is provided with a
positive number of samples, they will be fetched from the underlying document iterator, scored, and
passed to the implementing subclass so that equalisation information can be properly set up.
Additionally, this class ensures that if several scorers need access to intervals,
the document iterator to be scored is decorated with a
it.unimi.dsi.mg4j.search.CachingDocumentIterator ,
so that several scorer can access intervals.
Since this class uses the same document iterator for all aggregated scorers, they
must be necessarily
.
Implementing subclasses must provide the following methods:
Additionally, implementing subclasses must remember to call
AbstractAggregator.equalize(int) when generating a
,
so that the state of the aggregator is reproduced correctly.
|