Class ConstantScorer
- java.lang.Object
-
- it.unimi.di.big.mg4j.search.score.AbstractScorer
-
- it.unimi.di.big.mg4j.search.score.ConstantScorer
-
- All Implemented Interfaces:
DelegatingScorer,Scorer,FlyweightPrototype<Scorer>
public class ConstantScorer extends AbstractScorer implements DelegatingScorer
A scorer assigning a constant score (0 by default) to all documents.
-
-
Field Summary
Fields Modifier and Type Field Description doublescore-
Fields inherited from class it.unimi.di.big.mg4j.search.score.AbstractScorer
documentIterator, indexIterator
-
-
Constructor Summary
Constructors Constructor Description ConstantScorer()ConstantScorer(double score)ConstantScorer(String score)
-
Method Summary
Modifier and Type Method Description ConstantScorercopy()doublescore()Returns a score for the current document of the last document iterator given toScorer.wrap(DocumentIterator).doublescore(Index index)Returns a score for the current document of the last document iterator given toScorer.wrap(DocumentIterator), but considering only a given index (optional operation).StringtoString()booleanusesIntervals()Whether this scorer uses intervals.-
Methods inherited from class it.unimi.di.big.mg4j.search.score.AbstractScorer
getWeights, nextDocument, setWeights, wrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface it.unimi.di.big.mg4j.search.score.Scorer
getWeights, nextDocument, setWeights, wrap
-
-
-
-
Constructor Detail
-
ConstantScorer
public ConstantScorer(double score)
-
ConstantScorer
public ConstantScorer(String score)
-
ConstantScorer
public ConstantScorer()
-
-
Method Detail
-
score
public double score(Index index)
Description copied from interface:ScorerReturns a score for the current document of the last document iterator given toScorer.wrap(DocumentIterator), but considering only a given index (optional operation).
-
score
public double score()
Description copied from interface:ScorerReturns a score for the current document of the last document iterator given toScorer.wrap(DocumentIterator).
-
copy
public ConstantScorer copy()
- Specified by:
copyin interfaceFlyweightPrototype<Scorer>- Specified by:
copyin interfaceScorer
-
usesIntervals
public boolean usesIntervals()
Description copied from interface:ScorerWhether this scorer uses intervals.This method is essential when aggregating scorers, because if several scores need intervals, a
CachingDocumentIteratorwill be necessary.- Specified by:
usesIntervalsin interfaceScorer- Returns:
- true if this scorer uses intervals.
-
-