org.apache.lucene.facet.range

## Class Range

- java.lang.Object
- - org.apache.lucene.facet.range.Range

- Direct Known Subclasses:
    DoubleRange, LongRange

      public abstract class Range
      extends Object

  Base class for a single labeled range.
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `String` | `label` Label that identifies this range.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Range(String label)` Sole constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `failNoMatch()` Invoke this for a useless range.
    `abstract Query` | `getQuery(Query fastMatchQuery, ValueSource valueSource)` Returns a new `Query` accepting only documents in this range.
    `Query` | `getQuery(ValueSource valueSource)` Returns a new `Query` accepting only documents in this range.

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

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

- - ### Field Detail

    - #### label

          public final String label

      Label that identifies this range.

  - ### Constructor Detail

    - #### Range

          protected Range(String label)

      Sole constructor.

  - ### Method Detail

    - #### getQuery

          public abstract Query getQuery(Query fastMatchQuery,
                       ValueSource valueSource)

      Returns a new `Query` accepting only documents in this range. This query might not be very efficient when run on its own since it is optimized towards random-access, so it is best used either with `DrillDownQuery` or when intersected with another query that can lead the iteration. If the `ValueSource` is static, e.g. an indexed numeric field, then it may be more efficient to use `NumericRangeQuery`. The provided fastMatchQuery, if non-null, will first be consulted, and only if that is set for each document will the range then be checked.

    - #### getQuery

          public Query getQuery(ValueSource valueSource)

      Returns a new `Query` accepting only documents in this range. This query might not be very efficient when run on its own since it is optimized towards random-access, so it is best used either with `DrillDownQuery` or when intersected with another query that can lead the iteration. If the `ValueSource` is static, e.g. an indexed numeric field, then it may be more efficient to use `NumericRangeQuery`.

    - #### failNoMatch

          protected void failNoMatch()

      Invoke this for a useless range.

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