org.apache.lucene.search

## Class TermRangeFilter

- java.lang.Object
- - org.apache.lucene.search.Query
  - - org.apache.lucene.search.Filter
    - - org.apache.lucene.search.MultiTermQueryWrapperFilter<TermRangeQuery>
      - - org.apache.lucene.search.TermRangeFilter

- All Implemented Interfaces:
    Cloneable

  Deprecated.
  Use `TermRangeQuery` and `BooleanClause.Occur.FILTER` clauses instead.

      @Deprecated
      public class TermRangeFilter
      extends MultiTermQueryWrapperFilter<TermRangeQuery>

  A Filter that restricts search results to a range of term values in a given field.

  This filter matches the documents looking for terms that fall into the supplied range according to `Byte.compareTo(Byte)`, It is not intended for numerical ranges; use `NumericRangeFilter` instead.

  Since:
    2.9

- - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.search.MultiTermQueryWrapperFilter

      `query`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TermRangeFilter(String fieldName, BytesRef lowerTerm, BytesRef upperTerm, boolean includeLower, boolean includeUpper)` Deprecated.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `BytesRef` | `getLowerTerm()` Deprecated. Returns the lower value of this range filter
    `BytesRef` | `getUpperTerm()` Deprecated. Returns the upper value of this range filter
    `boolean` | `includesLower()` Deprecated. Returns `true` if the lower endpoint is inclusive
    `boolean` | `includesUpper()` Deprecated. Returns `true` if the upper endpoint is inclusive
    `static TermRangeFilter` | `Less(String fieldName, BytesRef upperTerm)` Deprecated. Constructs a filter for field `fieldName` matching less than or equal to `upperTerm`.
    `static TermRangeFilter` | `More(String fieldName, BytesRef lowerTerm)` Deprecated. Constructs a filter for field `fieldName` matching greater than or equal to `lowerTerm`.
    `static TermRangeFilter` | `newStringRange(String field, String lowerTerm, String upperTerm, boolean includeLower, boolean includeUpper)` Deprecated. Factory that creates a new TermRangeFilter using Strings for term text.

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

      `equals, getDocIdSet, getField, hashCode, toString`

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

      `rewrite`

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

      `clone, createWeight, getBoost, setBoost, toString`

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

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

- - ### Constructor Detail

    - #### TermRangeFilter

          public TermRangeFilter(String fieldName,
                         BytesRef lowerTerm,
                         BytesRef upperTerm,
                         boolean includeLower,
                         boolean includeUpper)

      Deprecated.
      Parameters:
        `fieldName` - The field this range applies to
        `lowerTerm` - The lower bound on this range
        `upperTerm` - The upper bound on this range
        `includeLower` - Does this range include the lower bound?
        `includeUpper` - Does this range include the upper bound?
      Throws:
        `IllegalArgumentException` - if both terms are null or if lowerTerm is null and includeLower is true (similar for upperTerm and includeUpper)

  - ### Method Detail

    - #### newStringRange

          public static TermRangeFilter newStringRange(String field,
                                       String lowerTerm,
                                       String upperTerm,
                                       boolean includeLower,
                                       boolean includeUpper)

      Deprecated.
      Factory that creates a new TermRangeFilter using Strings for term text.

    - #### Less

          public static TermRangeFilter Less(String fieldName,
                             BytesRef upperTerm)

      Deprecated.
      Constructs a filter for field `fieldName` matching less than or equal to `upperTerm`.

    - #### More

          public static TermRangeFilter More(String fieldName,
                             BytesRef lowerTerm)

      Deprecated.
      Constructs a filter for field `fieldName` matching greater than or equal to `lowerTerm`.

    - #### getLowerTerm

          public BytesRef getLowerTerm()

      Deprecated.
      Returns the lower value of this range filter

    - #### getUpperTerm

          public BytesRef getUpperTerm()

      Deprecated.
      Returns the upper value of this range filter

    - #### includesLower

          public boolean includesLower()

      Deprecated.
      Returns `true` if the lower endpoint is inclusive

    - #### includesUpper

          public boolean includesUpper()

      Deprecated.
      Returns `true` if the upper endpoint is inclusive

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