public abstract class PointRangeQuery extends Query
IntPoint
.
This is for subclasses and works on the underlying binary encoding: to
create range queries for lucene's standard Point
types, refer to factory
methods on those classes, e.g. IntPoint.newRangeQuery()
for
fields indexed with IntPoint
.
For a single-dimensional field this query is a simple range query; in a multi-dimensional field it's a box shape.
PointValues
Modifier | Constructor and Description |
---|---|
protected |
PointRangeQuery(String field,
byte[] lowerPoint,
byte[] upperPoint,
int numDims)
Expert: create a multidimensional range query for point values.
|
Modifier and Type | Method and Description |
---|---|
static void |
checkArgs(String field,
Object lowerPoint,
Object upperPoint)
Check preconditions for all factory methods
|
Weight |
createWeight(IndexSearcher searcher,
ScoreMode scoreMode,
float boost)
Expert: Constructs an appropriate Weight implementation for this query.
|
boolean |
equals(Object o)
Override and implement query instance equivalence properly in a subclass.
|
int |
getBytesPerDim() |
String |
getField() |
byte[] |
getLowerPoint() |
int |
getNumDims() |
byte[] |
getUpperPoint() |
int |
hashCode()
Override and implement query hash code properly in a subclass.
|
protected abstract String |
toString(int dimension,
byte[] value)
Returns a string of a single value in a human-readable format for debugging.
|
String |
toString(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
protected PointRangeQuery(String field, byte[] lowerPoint, byte[] upperPoint, int numDims)
field
- field name. must not be null
.lowerPoint
- lower portion of the range (inclusive).upperPoint
- upper portion of the range (inclusive).numDims
- number of dimensions.IllegalArgumentException
- if field
is null, or if lowerValue.length != upperValue.length
public static void checkArgs(String field, Object lowerPoint, Object upperPoint)
IllegalArgumentException
- if field
, lowerPoint
or upperPoint
are null.public void visit(QueryVisitor visitor)
Query
public final Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws 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.IOException
public String getField()
public int getNumDims()
public int getBytesPerDim()
public byte[] getLowerPoint()
public byte[] getUpperPoint()
public final int hashCode()
Query
QueryCache
works properly.hashCode
in class Query
Query.equals(Object)
public final boolean equals(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()
public final String toString(String field)
Query
field
assumed to be the
default field and omitted.protected abstract String toString(int dimension, byte[] value)
Query.toString()
.dimension
- dimension of the particular valuevalue
- single value, never nullCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.