org.apache.lucene.queryparser.surround.query

## Class SimpleTerm

- java.lang.Object
- - org.apache.lucene.queryparser.surround.query.SrndQuery
  - - org.apache.lucene.queryparser.surround.query.SimpleTerm

- All Implemented Interfaces:
    Cloneable, Comparable<SimpleTerm>, DistanceSubQuery
  Direct Known Subclasses:
    SrndPrefixQuery, SrndTermQuery, SrndTruncQuery

      public abstract class SimpleTerm
      extends SrndQuery
      implements DistanceSubQuery, Comparable<SimpleTerm>

  Base class for queries that expand to sets of simple terms.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `SimpleTerm.MatchingTermVisitor` Callback to visit each matching term during "rewrite" in `SimpleTerm.MatchingTermVisitor.visitMatchingTerm(Term)`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleTerm(boolean q)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addSpanQueries(SpanNearClauseFactory sncf)`
    `int` | `compareTo(SimpleTerm ost)` Deprecated. (March 2011) Not normally used, to be removed from Lucene 4.0. This class implementing Comparable is to be removed at the same time.
    `String` | `distanceSubQueryNotAllowed()` When distanceSubQueryNotAllowed() returns non null, the reason why the subquery is not allowed as a distance subquery is returned.
    `String` | `getFieldOperator()`
    `String` | `getQuote()`
    `Query` | `makeLuceneQueryFieldNoBoost(String fieldName, BasicQueryFactory qf)`
    `protected void` | `suffixToString(StringBuilder r)`
    `String` | `toString()` This method is used by `SrndQuery.hashCode()` and `SrndQuery.equals(Object)`, see LUCENE-2945.
    `abstract String` | `toStringUnquoted()`
    `abstract void` | `visitMatchingTerms(IndexReader reader, String fieldName, SimpleTerm.MatchingTermVisitor mtv)`

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

      `clone, equals, getWeight, getWeightOperator, getWeightString, hashCode, isFieldsSubQueryAcceptable, isWeighted, makeLuceneQueryField, setWeight, weightToString`

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

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

- - ### Constructor Detail

    - #### SimpleTerm

          public SimpleTerm(boolean q)

  - ### Method Detail

    - #### getQuote

          public String getQuote()

    - #### getFieldOperator

          public String getFieldOperator()

    - #### toStringUnquoted

          public abstract String toStringUnquoted()

    - #### compareTo

          @Deprecated
          public int compareTo(SimpleTerm ost)

      Deprecated. (March 2011) Not normally used, to be removed from Lucene 4.0. This class implementing Comparable is to be removed at the same time.
      Specified by:
        `compareTo` in interface `Comparable<SimpleTerm>`

    - #### suffixToString

          protected void suffixToString(StringBuilder r)

    - #### toString

          public String toString()

      Description copied from class: `SrndQuery`
      This method is used by `SrndQuery.hashCode()` and `SrndQuery.equals(Object)`, see LUCENE-2945.
      Specified by:
        `toString` in class `SrndQuery`

    - #### visitMatchingTerms

          public abstract void visitMatchingTerms(IndexReader reader,
                                                  String fieldName,
                                                  SimpleTerm.MatchingTermVisitor mtv)
                                           throws IOException

      Throws:
        `IOException`

    - #### distanceSubQueryNotAllowed

          public 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 IOException

      Specified by:
        `addSpanQueries` in interface `DistanceSubQuery`
      Throws:
        `IOException`

    - #### makeLuceneQueryFieldNoBoost

          public Query makeLuceneQueryFieldNoBoost(String fieldName,
                                                   BasicQueryFactory qf)

      Specified by:
        `makeLuceneQueryFieldNoBoost` in class `SrndQuery`

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