private class LongDistanceFeatureQuery.DistanceScorer extends Scorer
Scorable.ChildScorable
Modifier and Type | Field and Description |
---|---|
private float |
boost |
private int |
doc |
private NumericDocValues |
docValues |
private DocIdSetIterator |
it |
private long |
leadCost |
private long |
maxDistance |
private int |
maxDoc |
private PointValues |
pointValues |
private int |
setMinCompetitiveScoreCounter |
Modifier | Constructor and Description |
---|---|
protected |
DistanceScorer(Weight weight,
int maxDoc,
long leadCost,
float boost,
PointValues pointValues,
NumericDocValues docValues) |
Modifier and Type | Method and Description |
---|---|
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.
|
int |
docID()
Returns the doc ID that is currently being scored.
|
float |
getMaxScore(int upTo)
Return the maximum score that documents between the last
target
that this iterator was shallow-advanced to
included and upTo included. |
DocIdSetIterator |
iterator()
Return a
DocIdSetIterator 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 given
minScore . |
advanceShallow, getWeight, twoPhaseIterator
getChildren
private final int maxDoc
private DocIdSetIterator it
private int doc
private final long leadCost
private final float boost
private final PointValues pointValues
private final NumericDocValues docValues
private long maxDistance
private int setMinCompetitiveScoreCounter
protected DistanceScorer(Weight weight, int maxDoc, long leadCost, float boost, PointValues pointValues, NumericDocValues docValues)
public int docID()
Scorable
private float score(double distance)
private long computeMaxDistance(float minScore, long previousMaxDistance)
public float score() throws java.io.IOException
Scorable
public DocIdSetIterator iterator()
Scorer
DocIdSetIterator
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.public float getMaxScore(int upTo)
Scorer
target
that this iterator was shallow-advanced
to
included and upTo
included.getMaxScore
in class Scorer
public void setMinCompetitiveScore(float minScore) throws java.io.IOException
Scorable
minScore
. 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 of minScore
.setMinCompetitiveScore
in class Scorable
java.io.IOException