Package org.apache.lucene.queries.spans

## Class SpanWithinQuery

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

- All Implemented Interfaces:
    `Cloneable`

      public final class SpanWithinQuery
      extends SpanQuery

  Keep matches that are contained within another Spans.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `class` | `SpanWithinQuery.SpanWithinWeight` | Creates SpanWithinQuery scorer instances

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SpanWithinQuery​(SpanQuery big, SpanQuery little)` | Construct a SpanWithinQuery matching spans from `little` that are inside of `big`.

  - ### 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)` |
    `SpanQuery` | `getBig()` |
    `String` | `getField()` | Returns the name of the field matched by this query.
    `SpanQuery` | `getLittle()` |
    `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`

- - ### Constructor Detail

    - #### SpanWithinQuery

          public SpanWithinQuery​(SpanQuery big,
                                 SpanQuery little)

      Construct a SpanWithinQuery matching spans from `little` that are inside of `big`. This query has the boost of `little`. `big` and `little` must be in the same field.

  - ### Method Detail

    - #### toString

          public String toString​(String field)

      Specified by:
        `toString` in class `Query`

    - #### createWeight

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

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

    - #### 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`

    - #### getBig

          public SpanQuery getBig()

    - #### getLittle

          public SpanQuery getLittle()

    - #### 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`

    - #### equals

          public boolean equals​(Object other)

      Specified by:
        `equals` in class `Query`

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in class `Query`