public class VignaScorer extends AbstractWeightedScorer implements DelegatingScorer
This scorer progressively moves score from a residual (initialised to 1) to the current score (initialised to 0). For each interval, we move a fraction of the residual equal to the ratio of the extent over the interval length, minimised with 1 and divided by 2. For instance, on a two-term query meeting intervals of length 2 will increase the score from 0 to 1/2, 3/4 and so on. On the other hand, larger intervals take away less from the residual.
When the score exceeds .99, the computation is interrupted. In this way, we exploit
the laziness of the algorithms for minimal-interval
semantics implemented in it.unimi.di.big.mg4j.search, greatly improving performance for
extremely frequent terms, with no perceivable effect on the score itself.
index2WeightdocumentIterator, indexIterator| Constructor and Description |
|---|
VignaScorer() |
| Modifier and Type | Method and Description |
|---|---|
VignaScorer |
copy() |
double |
score(Index index)
Returns a score for the current document of the last document iterator
given to
Scorer.wrap(DocumentIterator), but
considering only a given index (optional operation). |
String |
toString() |
boolean |
usesIntervals()
Returns true.
|
getWeights, score, setWeights, wrapnextDocumentclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetWeights, nextDocument, score, setWeights, wrappublic double score(Index index) throws IOException
ScorerScorer.wrap(DocumentIterator), but
considering only a given index (optional operation).score in interface Scorerindex - the only index to be considered.IOExceptionpublic VignaScorer copy()
copy in interface Scorercopy in interface FlyweightPrototype<Scorer>public boolean usesIntervals()
usesIntervals in interface Scorer