Class FunctionRangeQuery
- java.lang.Object
-
- org.apache.lucene.search.Query
-
- org.apache.lucene.queries.function.FunctionRangeQuery
-
public class FunctionRangeQuery extends Query
A Query wrapping aValueSourcethat 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 aroundFunctionValues.getRangeScorer(Weight, LeafReaderContext, String, String, boolean, boolean).A similar class is
org.apache.lucene.search.DocValuesRangeQueryin 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 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 Description WeightcreateWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost)booleanequals(Object other)StringgetLowerVal()StringgetUpperVal()ValueSourcegetValueSource()inthashCode()booleanisIncludeLower()booleanisIncludeUpper()StringtoString(String field)voidvisit(QueryVisitor visitor)
-
-
-
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()
-
visit
public void visit(QueryVisitor visitor)
-
createWeight
public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException
- Overrides:
createWeightin classQuery- Throws:
IOException
-
-