it.unimi.di.mg4j.search.score
Class ConstantScorer
java.lang.Object
it.unimi.di.mg4j.search.score.AbstractScorer
it.unimi.di.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 |
double |
score
|
score
public final double score
ConstantScorer
public ConstantScorer(double score)
ConstantScorer
public ConstantScorer(String score)
ConstantScorer
public ConstantScorer()
score
public double score(Index index)
- Description copied from interface:
Scorer
- 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).
- Specified by:
score
in interface Scorer
- Parameters:
index
- the only index to be considered.
- Returns:
- the score.
score
public double score()
- Description copied from interface:
Scorer
- Returns a score for the current document of the last document iterator
given to
Scorer.wrap(DocumentIterator)
.
- Specified by:
score
in interface Scorer
- Returns:
- the score.
copy
public ConstantScorer copy()
- Specified by:
copy
in interface DelegatingScorer
- Specified by:
copy
in interface Scorer
- Specified by:
copy
in interface FlyweightPrototype<Scorer>
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 interface Scorer
- Returns:
- true if this scorer uses intervals.
toString
public String toString()
- Overrides:
toString
in class Object