abstract class RangeFieldQuery extends Query
RangeField
types by a defined PointValues.Relation
.Modifier and Type | Class and Description |
---|---|
(package private) static class |
RangeFieldQuery.QueryType
Used by
RangeFieldQuery to check how each internal or leaf node relates to the query. |
Modifier and Type | Field and Description |
---|---|
(package private) int |
bytesPerDim
number of bytes per dimension
|
(package private) java.lang.String |
field
field name
|
(package private) int |
numDims
number of dimensions - max 4
|
(package private) RangeFieldQuery.QueryType |
queryType
query relation
intersects:
CELL_CROSSES_QUERY ,
contains: CELL_CONTAINS_QUERY ,
within: CELL_WITHIN_QUERY |
(package private) byte[] |
ranges
ranges encoded as a sortable byte array
|
Constructor and Description |
---|
RangeFieldQuery(java.lang.String field,
byte[] ranges,
int numDims,
RangeFieldQuery.QueryType queryType)
Create a query for searching indexed ranges that match the provided relation.
|
Modifier and Type | Method and Description |
---|---|
private static void |
checkArgs(java.lang.String field,
byte[] ranges,
int numDims)
check input arguments
|
private void |
checkFieldInfo(FieldInfo fieldInfo)
Check indexed field info against the provided query data.
|
Weight |
createWeight(IndexSearcher searcher,
ScoreMode scoreMode,
float boost)
Expert: Constructs an appropriate Weight implementation for this query.
|
boolean |
equals(java.lang.Object o)
Override and implement query instance equivalence properly in a subclass.
|
protected boolean |
equalsTo(RangeFieldQuery other) |
int |
hashCode()
Override and implement query hash code properly in a subclass.
|
protected abstract java.lang.String |
toString(byte[] ranges,
int dimension)
Returns a string of a single value in a human-readable format for debugging.
|
java.lang.String |
toString(java.lang.String field)
Prints a query to a string, with
field assumed to be the
default field and omitted. |
void |
visit(QueryVisitor visitor)
Recurse through the query tree, visiting any child queries
|
classHash, rewrite, sameClassAs, toString
final java.lang.String field
final RangeFieldQuery.QueryType queryType
CELL_CROSSES_QUERY
,
contains: CELL_CONTAINS_QUERY
,
within: CELL_WITHIN_QUERY
final int numDims
final byte[] ranges
final int bytesPerDim
RangeFieldQuery(java.lang.String field, byte[] ranges, int numDims, RangeFieldQuery.QueryType queryType)
field
- field name. must not be null.ranges
- encoded range values; this is done by the RangeField
implementationqueryType
- the query relationprivate static void checkArgs(java.lang.String field, byte[] ranges, int numDims)
private void checkFieldInfo(FieldInfo fieldInfo)
public void visit(QueryVisitor visitor)
Query
public final Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws java.io.IOException
Query
Only implemented by primitive queries, which re-write to themselves.
createWeight
in class Query
scoreMode
- How the produced scorers will be consumed.boost
- The boost that is propagated by the parent queries.java.io.IOException
public int hashCode()
Query
QueryCache
works properly.hashCode
in class Query
Query.equals(Object)
public final boolean equals(java.lang.Object o)
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()
protected boolean equalsTo(RangeFieldQuery other)
public java.lang.String toString(java.lang.String field)
Query
field
assumed to be the
default field and omitted.protected abstract java.lang.String toString(byte[] ranges, int dimension)
Query.toString()
.dimension
- dimension of the particular valueranges
- encoded ranges, never null