public final class DocValuesRangeQuery extends Query
PointRangeQuery
.
NOTE: be very careful using this query: it is
typically much slower than using TermsQuery
,
but in certain specialized cases may be faster.
Modifier and Type | Method and Description |
---|---|
Weight |
createWeight(IndexSearcher searcher,
boolean needsScores)
Expert: Constructs an appropriate Weight implementation for this query.
|
boolean |
equals(Object other)
Override and implement query instance equivalence properly in a subclass.
|
String |
getField() |
Object |
getLowerVal() |
Object |
getUpperVal() |
int |
hashCode()
Override and implement query hash code properly in a subclass.
|
boolean |
isIncludeLower() |
boolean |
isIncludeUpper() |
static Query |
newBytesRefRange(String field,
BytesRef lowerVal,
BytesRef upperVal,
boolean includeLower,
boolean includeUpper)
Create a new numeric range query on a numeric doc-values field.
|
static Query |
newLongRange(String field,
Long lowerVal,
Long upperVal,
boolean includeLower,
boolean includeUpper)
Create a new numeric range query on a numeric doc-values field.
|
Query |
rewrite(IndexReader reader)
Expert: called to re-write queries into primitive queries.
|
String |
toString(String field)
Prints a query to a string, with
field assumed to be the
default field and omitted. |
classHash, sameClassAs, toString
public static Query newLongRange(String field, Long lowerVal, Long upperVal, boolean includeLower, boolean includeUpper)
DocValuesType.NUMERIC
or
DocValuesType.SORTED_NUMERIC
doc values.public static Query newBytesRefRange(String field, BytesRef lowerVal, BytesRef upperVal, boolean includeLower, boolean includeUpper)
DocValuesType.SORTED
or
DocValuesType.SORTED_SET
doc values.public boolean equals(Object other)
Query
QueryCache
works properly.
Typically a query will be equal to another only if it's an instance of
the same class and its document-filtering properties are identical that other
instance. Utility methods are provided for certain repetitive code.equals
in class Query
Query.sameClassAs(Object)
,
Query.classHash()
public int hashCode()
Query
QueryCache
works properly.hashCode
in class Query
Query.equals(Object)
public Object getLowerVal()
public Object getUpperVal()
public boolean isIncludeLower()
public boolean isIncludeUpper()
public String toString(String field)
Query
field
assumed to be the
default field and omitted.public Query rewrite(IndexReader reader) throws IOException
Query
rewrite
in class Query
IOException
public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException
Query
Only implemented by primitive queries, which re-write to themselves.
createWeight
in class Query
needsScores
- True if document scores (Scorer.score()
) or match
frequencies (Scorer.freq()
) are needed.IOException