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 double
score
-
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 ConstantScorer
copy()
double
score()
Returns a score for the current document of the last document iterator given toScorer.wrap(DocumentIterator)
.double
score(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).String
toString()
boolean
usesIntervals()
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:Scorer
Returns 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:Scorer
Returns a score for the current document of the last document iterator given toScorer.wrap(DocumentIterator)
.
-
copy
public ConstantScorer copy()
- Specified by:
copy
in interfaceFlyweightPrototype<Scorer>
- Specified by:
copy
in interfaceScorer
-
usesIntervals
public boolean usesIntervals()
Description copied from interface:Scorer
Whether this scorer uses intervals.This method is essential when aggregating scorers, because if several scores need intervals, a
CachingDocumentIterator
will be necessary.- Specified by:
usesIntervals
in interfaceScorer
- Returns:
- true if this scorer uses intervals.
-
-