Class PayloadTermQuery.PayloadTermWeight.PayloadTermSpanScorer
- java.lang.Object
-
- org.apache.lucene.search.DocIdSetIterator
-
- org.apache.lucene.search.Scorer
-
- org.apache.lucene.search.spans.SpanScorer
-
- org.apache.lucene.search.payloads.PayloadTermQuery.PayloadTermWeight.PayloadTermSpanScorer
-
- Enclosing class:
- PayloadTermQuery.PayloadTermWeight
protected class PayloadTermQuery.PayloadTermWeight.PayloadTermSpanScorer extends SpanScorer
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]
payload
protected float
payloadScore
protected int
payloadsSeen
protected TermPositions
positions
-
Fields inherited from class org.apache.lucene.search.spans.SpanScorer
doc, freq, more, norms, spans, value
-
Fields inherited from class org.apache.lucene.search.DocIdSetIterator
NO_MORE_DOCS
-
-
Constructor Summary
Constructors Constructor Description PayloadTermSpanScorer(TermSpans spans, Weight weight, Similarity similarity, byte[] norms)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Explanation
explain(int doc)
This method is no longer an official member ofScorer
, but it is needed by SpanWeight to build an explanation.protected float
getPayloadScore()
The score for the payloadprotected float
getSpanScore()
Returns the SpanScorer score only.protected void
processPayload(Similarity similarity)
float
score()
Returns the score of the current document matching the query.protected boolean
setFreqCurrentDoc()
-
Methods inherited from class org.apache.lucene.search.spans.SpanScorer
advance, docID, freq, nextDoc
-
Methods inherited from class org.apache.lucene.search.Scorer
getSimilarity, score, score, visitScorers, visitSubScorers
-
-
-
-
Field Detail
-
payload
protected byte[] payload
-
positions
protected TermPositions positions
-
payloadScore
protected float payloadScore
-
payloadsSeen
protected int payloadsSeen
-
-
Constructor Detail
-
PayloadTermSpanScorer
public PayloadTermSpanScorer(TermSpans spans, Weight weight, Similarity similarity, byte[] norms) throws IOException
- Throws:
IOException
-
-
Method Detail
-
setFreqCurrentDoc
protected boolean setFreqCurrentDoc() throws IOException
- Overrides:
setFreqCurrentDoc
in classSpanScorer
- Throws:
IOException
-
processPayload
protected void processPayload(Similarity similarity) throws IOException
- Throws:
IOException
-
score
public float score() throws IOException
Description copied from class:Scorer
Returns the score of the current document matching the query. Initially invalid, untilDocIdSetIterator.nextDoc()
orDocIdSetIterator.advance(int)
is called the first time, or when called from withinCollector.collect(int)
.- Overrides:
score
in classSpanScorer
- Returns:
getSpanScore()
*getPayloadScore()
- Throws:
IOException
-
getSpanScore
protected float getSpanScore() throws IOException
Returns the SpanScorer score only. Should not be overridden without good cause!- Returns:
- the score for just the Span part w/o the payload
- Throws:
IOException
- See Also:
score()
-
getPayloadScore
protected float getPayloadScore()
The score for the payload- Returns:
- The score, as calculated by
PayloadFunction.docScore(int, String, int, float)
-
explain
protected Explanation explain(int doc) throws IOException
Description copied from class:SpanScorer
This method is no longer an official member ofScorer
, but it is needed by SpanWeight to build an explanation.- Overrides:
explain
in classSpanScorer
- Throws:
IOException
-
-