Package org.apache.lucene.queries.payloads

## Class SpanPayloadCheckQuery

- java.lang.Object
- - org.apache.lucene.search.Query
  - - org.apache.lucene.queries.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 | Description
    --- | --- | ---
    `static class` | `SpanPayloadCheckQuery.MatchOperation` | The payload type.
    `static class` | `SpanPayloadCheckQuery.PayloadType` | The payload type.
    `class` | `SpanPayloadCheckQuery.SpanPayloadCheckWeight` | Weight that pulls its Spans using a PayloadSpanCollector

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected SpanQuery` | `match` |
    `protected SpanPayloadCheckQuery.MatchOperation` | `operation` |
    `protected List<BytesRef>` | `payloadToMatch` |
    `protected SpanPayloadCheckQuery.PayloadType` | `payloadType` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SpanPayloadCheckQuery​(SpanQuery match, List<BytesRef> payloadToMatch)` |
    `SpanPayloadCheckQuery​(SpanQuery match, List<BytesRef> payloadToMatch, SpanPayloadCheckQuery.PayloadType payloadType, SpanPayloadCheckQuery.MatchOperation operation)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `SpanWeight` | `createWeight​(IndexSearcher searcher, ScoreMode scoreMode, float boost)` |
    `boolean` | `equals​(Object other)` |
    `String` | `getField()` | Returns the name of the field matched by this query.
    `int` | `hashCode()` |
    `Query` | `rewrite​(IndexSearcher indexSearcher)` |
    `String` | `toString​(String field)` |
    `void` | `visit​(QueryVisitor visitor)` |

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

      `getTermStates, getTermStates`

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

      `classHash, rewrite, 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

    - #### operation

          protected final SpanPayloadCheckQuery.MatchOperation operation

    - #### payloadType

          protected final SpanPayloadCheckQuery.PayloadType payloadType

  - ### Constructor Detail

    - #### SpanPayloadCheckQuery

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

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

    - #### SpanPayloadCheckQuery

          public SpanPayloadCheckQuery​(SpanQuery match,
                                       List<BytesRef> payloadToMatch,
                                       SpanPayloadCheckQuery.PayloadType payloadType,
                                       SpanPayloadCheckQuery.MatchOperation operation)

      Parameters:
        `match` - The underlying `SpanQuery` to check
        `payloadToMatch` - The `List` of payloads to match
        `operation` - The equality check, lt, lte, gt, gte, or eq. Defaults to eq for equals)
        `payloadType` - specify if the format of the bytes in the payload (String, Integer, or Float)

  - ### Method Detail

    - #### getField

          public String getField()

      Description copied from class: `SpanQuery`
      Returns the name of the field matched by this query.
      Specified by:
        `getField` in class `SpanQuery`

    - #### createWeight

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

      Specified by:
        `createWeight` in class `SpanQuery`
      Throws:
        `IOException`

    - #### rewrite

          public Query rewrite​(IndexSearcher indexSearcher)
                        throws IOException

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

    - #### visit

          public void visit​(QueryVisitor visitor)

      Specified by:
        `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`