Class FunctionRangeQuery
- java.lang.Object
-
- org.apache.lucene.search.Query
-
- org.apache.lucene.queries.function.FunctionRangeQuery
-
public class FunctionRangeQuery extends Query
A Query wrapping aValueSource
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 aroundFunctionValues.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 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 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
-
-
-
-
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:
createWeight
in classQuery
- Throws:
IOException
-
-