Package org.apache.lucene.queries.spans

## Class SpanScorer

- java.lang.Object
- - org.apache.lucene.search.Scorable
  - - org.apache.lucene.search.Scorer
    - - org.apache.lucene.queries.spans.SpanScorer

-     public class SpanScorer
      extends Scorer

  A basic `Scorer` over `Spans`.
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.lucene.search.Scorable

      `Scorable.ChildScorable`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected LeafSimScorer` | `docScorer` |
    `protected Spans` | `spans` |

    - ### Fields inherited from class org.apache.lucene.search.Scorer

      `weight`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SpanScorer​(SpanWeight weight, Spans spans, LeafSimScorer docScorer)` | Sole constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `docID()` |
    `float` | `getMaxScore​(int upTo)` |
    `Spans` | `getSpans()` | return the Spans for this Scorer *
    `DocIdSetIterator` | `iterator()` |
    `float` | `score()` |
    `protected float` | `scoreCurrentDoc()` | Score the current doc.
    `protected void` | `setFreqCurrentDoc()` | Sets `freq` for the current document.
    `TwoPhaseIterator` | `twoPhaseIterator()` |

    - ### Methods inherited from class org.apache.lucene.search.Scorer

      `advanceShallow, getWeight`

    - ### Methods inherited from class org.apache.lucene.search.Scorable

      `getChildren, setMinCompetitiveScore, smoothingScore`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### spans

          protected final Spans spans

    - #### docScorer

          protected final LeafSimScorer docScorer

  - ### Constructor Detail

    - #### SpanScorer

          public SpanScorer​(SpanWeight weight,
                            Spans spans,
                            LeafSimScorer docScorer)

      Sole constructor.

  - ### Method Detail

    - #### getSpans

          public Spans getSpans()

      return the Spans for this Scorer *

    - #### docID

          public int docID()

      Specified by:
        `docID` in class `Scorable`

    - #### iterator

          public DocIdSetIterator iterator()

      Specified by:
        `iterator` in class `Scorer`

    - #### twoPhaseIterator

          public TwoPhaseIterator twoPhaseIterator()

      Overrides:
        `twoPhaseIterator` in class `Scorer`

    - #### scoreCurrentDoc

          protected float scoreCurrentDoc()
                                   throws IOException

      Score the current doc. The default implementation scores the doc with the similarity using the slop-adjusted `freq`.
      Throws:
        `IOException`

    - #### setFreqCurrentDoc

          protected final void setFreqCurrentDoc()
                                          throws IOException

      Sets `freq` for the current document.

      This will be called at most once per document.

      Throws:
        `IOException`

    - #### score

          public final float score()
                            throws IOException

      Specified by:
        `score` in class `Scorable`
      Throws:
        `IOException`

    - #### getMaxScore

          public float getMaxScore​(int upTo)
                            throws IOException

      Specified by:
        `getMaxScore` in class `Scorer`
      Throws:
        `IOException`