org.apache.lucene.queryParser.surround.query

## Class DistanceQuery

- java.lang.Object
- - org.apache.lucene.queryParser.surround.query.SrndQuery
  - - org.apache.lucene.queryParser.surround.query.ComposedQuery
    - - org.apache.lucene.queryParser.surround.query.DistanceQuery

- All Implemented Interfaces:
    java.lang.Cloneable, DistanceSubQuery

      public class DistanceQuery
      extends ComposedQuery
      implements DistanceSubQuery

- - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.queryParser.surround.query.SrndQuery

      `theEmptyLcnQuery`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DistanceQuery(java.util.List queries, boolean infix, int opDistance, java.lang.String opName, boolean ordered)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addSpanQueries(SpanNearClauseFactory sncf)`
    `java.lang.String` | `distanceSubQueryNotAllowed()` When distanceSubQueryNotAllowed() returns non null, the reason why the subquery is not allowed as a distance subquery is returned.
    `int` | `getOpDistance()`
    `org.apache.lucene.search.Query` | `getSpanNearQuery(org.apache.lucene.index.IndexReader reader, java.lang.String fieldName, float boost, BasicQueryFactory qf)`
    `org.apache.lucene.search.Query` | `makeLuceneQueryFieldNoBoost(java.lang.String fieldName, BasicQueryFactory qf)`
    `boolean` | `subQueriesOrdered()`

    - ### Methods inherited from class org.apache.lucene.queryParser.surround.query.ComposedQuery

      `getBracketClose, getBracketOpen, getNrSubQueries, getOperatorName, getPrefixSeparator, getSubQueriesIterator, getSubQuery, infixToString, isFieldsSubQueryAcceptable, isOperatorInfix, makeLuceneSubQueriesField, prefixToString, recompose, toString`

    - ### Methods inherited from class org.apache.lucene.queryParser.surround.query.SrndQuery

      `clone, getWeight, getWeightOperator, getWeightString, isWeighted, makeLuceneQueryField, setWeight, weightToString`

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

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

- - ### Constructor Detail

    - #### DistanceQuery

          public DistanceQuery(java.util.List queries,
                               boolean infix,
                               int opDistance,
                               java.lang.String opName,
                               boolean ordered)

  - ### Method Detail

    - #### getOpDistance

          public int getOpDistance()

    - #### subQueriesOrdered

          public boolean subQueriesOrdered()

    - #### distanceSubQueryNotAllowed

          public java.lang.String distanceSubQueryNotAllowed()

      Description copied from interface: `DistanceSubQuery`
      When distanceSubQueryNotAllowed() returns non null, the reason why the subquery is not allowed as a distance subquery is returned.
      When distanceSubQueryNotAllowed() returns null addSpanNearQueries() can be used in the creation of the span near clause for the subquery.
      Specified by:
        `distanceSubQueryNotAllowed` in interface `DistanceSubQuery`

    - #### addSpanQueries

          public void addSpanQueries(SpanNearClauseFactory sncf)
                              throws java.io.IOException

      Specified by:
        `addSpanQueries` in interface `DistanceSubQuery`
      Throws:
        `java.io.IOException`

    - #### makeLuceneQueryFieldNoBoost

          public org.apache.lucene.search.Query makeLuceneQueryFieldNoBoost(java.lang.String fieldName,
                                                                            BasicQueryFactory qf)

      Specified by:
        `makeLuceneQueryFieldNoBoost` in class `SrndQuery`

    - #### getSpanNearQuery

          public org.apache.lucene.search.Query getSpanNearQuery(org.apache.lucene.index.IndexReader reader,
                                                                 java.lang.String fieldName,
                                                                 float boost,
                                                                 BasicQueryFactory qf)
                                                          throws java.io.IOException

      Throws:
        `java.io.IOException`

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