Module org.apache.lucene.core
Package org.apache.lucene.document
Class LongDistanceFeatureQuery.DistanceScorer
java.lang.Object
org.apache.lucene.search.Scorable
org.apache.lucene.search.Scorer
org.apache.lucene.document.LongDistanceFeatureQuery.DistanceScorer
- Enclosing class:
LongDistanceFeatureQuery
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.search.Scorable
Scorable.ChildScorable -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final floatprivate intprivate final NumericDocValuesprivate DocIdSetIteratorprivate final longprivate longprivate final intprivate final PointValuesprivate int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDistanceScorer(Weight weight, int maxDoc, long leadCost, float boost, PointValues pointValues, NumericDocValues docValues) -
Method Summary
Modifier and TypeMethodDescriptionprivate longcomputeMaxDistance(float minScore, long previousMaxDistance) Inverting the score computation is very hard due to all potential rounding errors, so we binary search the maximum distance.intdocID()Returns the doc ID that is currently being scored.floatgetMaxScore(int upTo) Return the maximum score that documents between the lasttargetthat this iterator wasshallow-advancedto included andupToincluded.iterator()Return aDocIdSetIteratorover matching documents.floatscore()Returns the score of the current document matching the query.private floatscore(long distance) voidsetMinCompetitiveScore(float minScore) Optional method: Tell the scorer that its iterator may safely ignore all documents whose score is less than the givenminScore.Methods inherited from class org.apache.lucene.search.Scorer
advanceShallow, getWeight, twoPhaseIteratorMethods inherited from class org.apache.lucene.search.Scorable
getChildren, smoothingScore
-
Field Details
-
maxDoc
private final int maxDoc -
it
-
doc
private int doc -
leadCost
private final long leadCost -
boost
private final float boost -
pointValues
-
docValues
-
maxDistance
private long maxDistance -
setMinCompetitiveScoreCounter
private int setMinCompetitiveScoreCounter
-
-
Constructor Details
-
DistanceScorer
protected DistanceScorer(Weight weight, int maxDoc, long leadCost, float boost, PointValues pointValues, NumericDocValues docValues)
-
-
Method Details
-
docID
public int docID()Description copied from class:ScorableReturns the doc ID that is currently being scored. -
score
private float score(long distance) -
computeMaxDistance
private long computeMaxDistance(float minScore, long previousMaxDistance) Inverting the score computation is very hard due to all potential rounding errors, so we binary search the maximum distance. -
score
Description copied from class:ScorableReturns the score of the current document matching the query.- Specified by:
scorein classScorable- Throws:
IOException
-
iterator
Description copied from class:ScorerReturn aDocIdSetIteratorover matching documents.The returned iterator will either be positioned on
-1if no documents have been scored yet,DocIdSetIterator.NO_MORE_DOCSif all documents have been scored already, or the last document id that has been scored otherwise.The returned iterator is a view: calling this method several times will return iterators that have the same state.
-
getMaxScore
public float getMaxScore(int upTo) Description copied from class:ScorerReturn the maximum score that documents between the lasttargetthat this iterator wasshallow-advancedto included andupToincluded.- Specified by:
getMaxScorein classScorer
-
setMinCompetitiveScore
Description copied from class:ScorableOptional method: Tell the scorer that its iterator may safely ignore all documents whose score is less than the givenminScore. This is a no-op by default.This method may only be called from collectors that use
ScoreMode.TOP_SCORES, and successive calls may only set increasing values ofminScore.- Overrides:
setMinCompetitiveScorein classScorable- Throws:
IOException
-