Package org.apache.lucene.document
Class LatLonPointDistanceFeatureQuery.DistanceScorer
java.lang.Object
org.apache.lucene.search.Scorable
org.apache.lucene.search.Scorer
org.apache.lucene.document.LatLonPointDistanceFeatureQuery.DistanceScorer
- Enclosing class:
- LatLonPointDistanceFeatureQuery
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.search.Scorable
Scorable.ChildScorable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final float
private int
private final NumericDocValues
private DocIdSetIterator
private final long
private double
private final int
private final PointValues
private int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DistanceScorer
(Weight weight, int maxDoc, long leadCost, float boost, PointValues pointValues, NumericDocValues docValues) -
Method Summary
Modifier and TypeMethodDescriptionprivate double
computeMaxDistance
(float minScore, double previousMaxDistance) Inverting the score computation is very hard due to all potential rounding errors, so we binary search the maximum distance.int
docID()
Returns the doc ID that is currently being scored.float
getMaxScore
(int upTo) Return the maximum score that documents between the lasttarget
that this iterator wasshallow-advanced
to included andupTo
included.iterator()
Return aDocIdSetIterator
over matching documents.float
score()
Returns the score of the current document matching the query.private float
score
(double distance) void
setMinCompetitiveScore
(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, twoPhaseIterator
Methods 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 double 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:Scorable
Returns the doc ID that is currently being scored. -
score
private float score(double distance) -
computeMaxDistance
private double computeMaxDistance(float minScore, double previousMaxDistance) Inverting the score computation is very hard due to all potential rounding errors, so we binary search the maximum distance. The limit is set to 1 meter. -
score
Description copied from class:Scorable
Returns the score of the current document matching the query.- Specified by:
score
in classScorable
- Throws:
IOException
-
iterator
Description copied from class:Scorer
Return aDocIdSetIterator
over matching documents.The returned iterator will either be positioned on
-1
if no documents have been scored yet,DocIdSetIterator.NO_MORE_DOCS
if 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:Scorer
Return the maximum score that documents between the lasttarget
that this iterator wasshallow-advanced
to included andupTo
included.- Specified by:
getMaxScore
in classScorer
-
setMinCompetitiveScore
Description copied from class:Scorable
Optional 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:
setMinCompetitiveScore
in classScorable
- Throws:
IOException
-