Class FunctionRangeQuery
java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.queries.function.FunctionRangeQuery
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:
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Constructor Summary
ConstructorDescriptionFunctionRangeQuery
(ValueSource valueSource, Number lowerVal, Number upperVal, boolean includeLower, boolean includeUpper) FunctionRangeQuery
(ValueSource valueSource, String lowerVal, String upperVal, boolean includeLower, boolean includeUpper) -
Method Summary
Modifier and TypeMethodDescriptioncreateWeight
(IndexSearcher searcher, ScoreMode scoreMode, float boost) boolean
int
hashCode()
boolean
boolean
void
visit
(QueryVisitor visitor)
-
Constructor Details
-
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 Details
-
getValueSource
-
getLowerVal
-
getUpperVal
-
isIncludeLower
public boolean isIncludeLower() -
isIncludeUpper
public boolean isIncludeUpper() -
toString
-
equals
-
hashCode
public int hashCode() -
visit
-
createWeight
public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException - Overrides:
createWeight
in classQuery
- Throws:
IOException
-