Module org.apache.lucene.core
Class SimilarityBase.BasicSimScorer
java.lang.Object
org.apache.lucene.search.similarities.Similarity.SimScorer
org.apache.lucene.search.similarities.SimilarityBase.BasicSimScorer
- Enclosing class:
SimilarityBase
Delegates the
score(float, long) and explain(Explanation, long) methods to
SimilarityBase.score(BasicStats, double, double) and SimilarityBase.explain(BasicStats, Explanation, double), respectively.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexplain(Explanation freq, long norm) Explain the score for a single document(package private) doublegetLengthValue(long norm) floatscore(float freq, long norm) Score a single document.
-
Field Details
-
stats
-
-
Constructor Details
-
BasicSimScorer
BasicSimScorer(BasicStats stats)
-
-
Method Details
-
getLengthValue
double getLengthValue(long norm) -
score
public float score(float freq, long norm) Description copied from class:Similarity.SimScorerScore a single document.freqis the document-term sloppy frequency and must be finite and positive.normis the encoded normalization factor as computed bySimilarity.computeNorm(FieldInvertState)at index time, or1if norms are disabled.normis never0.Score must not decrease when
freqincreases, ie. iffreq1 > freq2, thenscore(freq1, norm) >= score(freq2, norm)for any value ofnormthat may be produced bySimilarity.computeNorm(FieldInvertState).Score must not increase when the unsigned
normincreases, ie. ifLong.compareUnsigned(norm1, norm2) > 0thenscore(freq, norm1) <= score(freq, norm2)for any legalfreq.As a consequence, the maximum score that this scorer can produce is bound by
score(Float.MAX_VALUE, 1).- Specified by:
scorein classSimilarity.SimScorer- Parameters:
freq- sloppy term frequency, must be finite and positivenorm- encoded normalization factor or1if norms are disabled- Returns:
- document's score
-
explain
Description copied from class:Similarity.SimScorerExplain the score for a single document- Overrides:
explainin classSimilarity.SimScorer- Parameters:
freq- Explanation of how the sloppy term frequency was computednorm- encoded normalization factor, as returned bySimilarity.computeNorm(org.apache.lucene.index.FieldInvertState), or1if norms are disabled- Returns:
- document's score
-