org.apache.lucene.queries.function

## Class FunctionRangeQuery

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

-     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(Weight, LeafReaderContext, 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

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Weight` | `createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost)`
    `boolean` | `equals(Object other)`
    `String` | `getLowerVal()`
    `String` | `getUpperVal()`
    `ValueSource` | `getValueSource()`
    `int` | `hashCode()`
    `boolean` | `isIncludeLower()`
    `boolean` | `isIncludeUpper()`
    `String` | `toString(String field)`
    `void` | `visit(QueryVisitor visitor)`

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

      `classHash, rewrite, sameClassAs, toString`

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

      `clone, 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

    - #### getValueSource

          public ValueSource getValueSource()

    - #### getLowerVal

          public String getLowerVal()

    - #### getUpperVal

          public String getUpperVal()

    - #### isIncludeLower

          public boolean isIncludeLower()

    - #### isIncludeUpper

          public boolean isIncludeUpper()

    - #### toString

          public String toString(String field)

      Specified by:
        `toString` in class `Query`

    - #### equals

          public boolean equals(Object other)

      Specified by:
        `equals` in class `Query`

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in class `Query`

    - #### visit

          public void visit(QueryVisitor visitor)

      Overrides:
        `visit` in class `Query`

    - #### createWeight

          public Weight createWeight(IndexSearcher searcher,
                                     ScoreMode scoreMode,
                                     float boost)
                              throws IOException

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

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