org.apache.lucene.search.spans

## Class SpanNearQuery.Builder

- java.lang.Object
- - org.apache.lucene.search.spans.SpanNearQuery.Builder

- Enclosing class:
    SpanNearQuery

      public static class SpanNearQuery.Builder
      extends Object

  A builder for SpanNearQueries

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Builder(String field, boolean ordered)` Construct a new builder

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SpanNearQuery.Builder` | `addClause(SpanQuery clause)` Add a new clause
    `SpanNearQuery.Builder` | `addGap(int width)` Add a gap after the previous clause of a defined width
    `SpanNearQuery` | `build()` Build the query
    `SpanNearQuery.Builder` | `setSlop(int slop)` Set the slop for this query

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

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

- - ### Constructor Detail

    - #### Builder

          public Builder(String field,
                         boolean ordered)

      Construct a new builder
      Parameters:
        `field` - the field to search in
        `ordered` - whether or not clauses must be in-order to match

  - ### Method Detail

    - #### addClause

          public SpanNearQuery.Builder addClause(SpanQuery clause)

      Add a new clause

    - #### addGap

          public SpanNearQuery.Builder addGap(int width)

      Add a gap after the previous clause of a defined width

    - #### setSlop

          public SpanNearQuery.Builder setSlop(int slop)

      Set the slop for this query

    - #### build

          public SpanNearQuery build()

      Build the query

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