## org.apache.lucene.search.payloads
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
`protected byte[]` `payload`
`protected float` `payloadScore`
`protected int` `payloadsSeen`
`protected TermPositions` `positions`

Fields inherited from class org.apache.lucene.search.spans.SpanScorer
`doc, firstTime, freq, more, norms, spans, value, weight`

Fields inherited from class org.apache.lucene.search.DocIdSetIterator
`NO_MORE_DOCS`

Constructor Summary
`PayloadTermQuery.PayloadTermWeight.PayloadTermSpanScorer(TermSpans spans, Weight weight, Similarity similarity, byte[] norms)`

Method Summary
`Explanation` `explain(int doc)` Returns an explanation of the score for a document.
`protected float` `getPayloadScore()` The score for the payload
`protected 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, doc, docID, next, nextDoc, skipTo`

Methods inherited from class org.apache.lucene.search.Scorer
`getSimilarity, score, score, score, score`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### payload

    protected byte[] payload

### positions

    protected TermPositions positions

### payloadScore

    protected float payloadScore

### payloadsSeen

    protected int payloadsSeen

Constructor Detail

### PayloadTermQuery.PayloadTermWeight.PayloadTermSpanScorer

    public PayloadTermQuery.PayloadTermWeight.PayloadTermSpanScorer(TermSpans spans,
                                                                    Weight weight,
                                                                    Similarity similarity,
                                                                    byte[] norms)
                                                             throws java.io.IOException

Throws:
  `java.io.IOException`

Method Detail

### setFreqCurrentDoc

    protected boolean setFreqCurrentDoc()
                                 throws java.io.IOException

  Overrides:
    `setFreqCurrentDoc` in class `SpanScorer`
  Throws:
    `java.io.IOException`

### processPayload

    protected void processPayload(Similarity similarity)
                           throws java.io.IOException

  Throws:
    `java.io.IOException`

### score

    public float score()
                throws java.io.IOException

  Description copied from class: `Scorer`
  Returns the score of the current document matching the query. Initially invalid, until `DocIdSetIterator.next()` or `DocIdSetIterator.skipTo(int)` is called the first time, or when called from within `Collector.collect(int)`.

  Overrides:
    `score` in class `SpanScorer`
  Returns:
    `getSpanScore()` * `getPayloadScore()`
  Throws:
    `java.io.IOException`

### getSpanScore

    protected float getSpanScore()
                          throws java.io.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:
    `java.io.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

    public Explanation explain(int doc)
                        throws java.io.IOException

  Description copied from class: `Scorer`
  Returns an explanation of the score for a document.
  When this method is used, the `DocIdSetIterator.next()`, `DocIdSetIterator.skipTo(int)` and `Scorer.score(HitCollector)` methods should not be used.

  Overrides:
    `explain` in class `SpanScorer`
  Parameters:
    `doc` - The document number for the explanation.
  Throws:
    `java.io.IOException`

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.