org.apache.lucene.queries.payloads

## Class SpanPayloadCheckQuery

- java.lang.Object
- - org.apache.lucene.search.Query
  - - org.apache.lucene.search.spans.SpanQuery
    - - org.apache.lucene.queries.payloads.SpanPayloadCheckQuery

-     public class SpanPayloadCheckQuery
      extends SpanQuery

  Only return those matches that have a specific payload at the given position.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `SpanPayloadCheckQuery.SpanPayloadCheckWeight` Weight that pulls its Spans using a PayloadSpanCollector

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected SpanQuery` | `match`
    `protected List<BytesRef>` | `payloadToMatch`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SpanPayloadCheckQuery(SpanQuery match, List<BytesRef> payloadToMatch)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SpanWeight` | `createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost)`
    `boolean` | `equals(Object other)`
    `String` | `getField()`
    `int` | `hashCode()`
    `Query` | `rewrite(IndexReader reader)`
    `String` | `toString(String field)`
    `void` | `visit(QueryVisitor visitor)`

    - ### Methods inherited from class org.apache.lucene.search.spans.SpanQuery

      `getTermStates, getTermStates`

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

      `classHash, sameClassAs, toString`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### payloadToMatch

          protected final List<BytesRef> payloadToMatch

    - #### match

          protected final SpanQuery match

  - ### Constructor Detail

    - #### SpanPayloadCheckQuery

          public SpanPayloadCheckQuery(SpanQuery match,
                                       List<BytesRef> payloadToMatch)

      Parameters:
        `match` - The underlying `SpanQuery` to check
        `payloadToMatch` - The `List` of payloads to match

  - ### Method Detail

    - #### getField

          public String getField()

      Specified by:
        `getField` in class `SpanQuery`

    - #### createWeight

          public SpanWeight createWeight(IndexSearcher searcher,
                                         ScoreMode scoreMode,
                                         float boost)
                                  throws IOException

      Overrides:
        `createWeight` in class `SpanQuery`
      Throws:
        `IOException`

    - #### rewrite

          public Query rewrite(IndexReader reader)
                        throws IOException

      Overrides:
        `rewrite` in class `Query`
      Throws:
        `IOException`

    - #### visit

          public void visit(QueryVisitor visitor)

      Overrides:
        `visit` in class `Query`

    - #### toString

          public String toString(String field)

      Specified by:
        `toString` in class `Query`

    - #### equals

          public boolean equals(Object other)

      Specified by:
        `equals` in class `Query`

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in class `Query`

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