|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.unimi.dsi.mg4j.search.score.LinearAggregator
Merges a number of ScoredDocumentIterator
s,
obtaining a new ScoredDocumentIterator
.
This is done in the following way: you provide an LinearAggregator
with a number of ScoredDocumentIterator
s,
each with an associated weight and a boolean (called relevance
flag).
A document is said to be relevant iff it is returned
by at least one of the ScoredDocumentIterator
s
that have the relevance flag set. For every relevant document, its
aggregate score is obtained by combining linearly (using the
given weights) the scores returned by the ScoredDocumentIterator
s
for that index. The scores returned by each ScoredDocumentIterator
are firstly normalized (i.e., they are divided by the greatest score they ever return, unless
they are constantly zero).
Note that the aggregate iterator returned by the aggregation method will only return documents and their scores (no interval iterators!).
Constructor Summary | |
LinearAggregator(boolean[] relevant,
double[] weight)
Creates a linear aggregator. |
Method Summary | |
ScoredDocumentIterator |
aggregate(ScoredDocumentIterator[] underlying)
Aggregates the given ScoredDocumentIterator s, that must be in the same
number as there are weights (and relevance flags). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LinearAggregator(boolean[] relevant, double[] weight)
relevant
- the array of relevance flags.weight
- the array of weights.Method Detail |
public ScoredDocumentIterator aggregate(ScoredDocumentIterator[] underlying)
ScoredDocumentIterator
s, that must be in the same
number as there are weights (and relevance flags).
underlying
- the underlying iterators to be merged.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |