Package org.apache.lucene.search
Class MaxScoreCache
- java.lang.Object
-
- org.apache.lucene.search.MaxScoreCache
-
public final class MaxScoreCache extends Object
Compute maximum scores based onImpacts
and keep them in a cache in order not to run expensive similarity score computations multiple times on the same data.- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
-
Constructor Summary
Constructors Constructor Description MaxScoreCache(ImpactsSource impactsSource, Similarity.SimScorer scorer)
Sole constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
advanceShallow(int target)
Implement the contract ofScorer.advanceShallow(int)
based on the wrappedImpactsSource
.float
getMaxScore(int upTo)
Return the maximum score up to upTo included.
-
-
-
Constructor Detail
-
MaxScoreCache
public MaxScoreCache(ImpactsSource impactsSource, Similarity.SimScorer scorer)
Sole constructor.
-
-
Method Detail
-
advanceShallow
public int advanceShallow(int target) throws IOException
Implement the contract ofScorer.advanceShallow(int)
based on the wrappedImpactsSource
.- Throws:
IOException
- See Also:
Scorer.advanceShallow(int)
-
getMaxScore
public float getMaxScore(int upTo) throws IOException
Return the maximum score up to upTo included.- Throws:
IOException
- See Also:
Scorer.getMaxScore(int)
-
-