org.apache.lucene.queries.function

## Class FunctionRangeQuery

- java.lang.Object
- - org.apache.lucene.search.Query
  - - org.apache.lucene.queries.function.FunctionRangeQuery

- All Implemented Interfaces:
    Cloneable

      public class FunctionRangeQuery
      extends Query

  A Query wrapping a `ValueSource` that matches docs in which the values in the value source match a configured range. The score is the float value. This can be a slow query if run by itself since it must visit all docs; ideally it's combined with other queries. It's mostly a wrapper around `FunctionValues.getRangeScorer(IndexReader, String, String, boolean, boolean)`. A similar class is `org.apache.lucene.search.DocValuesRangeQuery` in the sandbox module. That one is constant scoring.
  See Also:
    `(constant scoring)`
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FunctionRangeQuery(ValueSource valueSource, Number lowerVal, Number upperVal, boolean includeLower, boolean includeUpper)`
    `FunctionRangeQuery(ValueSource valueSource, String lowerVal, String upperVal, boolean includeLower, boolean includeUpper)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Weight` | `createWeight(IndexSearcher searcher, boolean needsScores)`
    `boolean` | `equals(Object o)`
    `int` | `hashCode()`
    `String` | `toString(String field)`

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

      `clone, getBoost, rewrite, setBoost, toString`

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

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

- - ### Constructor Detail

    - #### FunctionRangeQuery

          public FunctionRangeQuery(ValueSource valueSource,
                            Number lowerVal,
                            Number upperVal,
                            boolean includeLower,
                            boolean includeUpper)

    - #### FunctionRangeQuery

          public FunctionRangeQuery(ValueSource valueSource,
                            String lowerVal,
                            String upperVal,
                            boolean includeLower,
                            boolean includeUpper)

  - ### Method Detail

    - #### toString

          public String toString(String field)

      Specified by:
        `toString` in class `Query`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Query`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Query`

    - #### createWeight

          public Weight createWeight(IndexSearcher searcher,
                            boolean needsScores)
                              throws IOException

      Overrides:
        `createWeight` in class `Query`
      Throws:
        `IOException`

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