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,
boolean needsScores,
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. |
classHash, rewrite, sameClassAs, toStringprotected 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.lengthpublic static void checkArgs(String field, Object lowerPoint, Object upperPoint)
IllegalArgumentException - if field, lowerPoint or upperPoint are null.public final Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException
QueryOnly implemented by primitive queries, which re-write to themselves.
createWeight in class QueryneedsScores - True if document scores (Scorer.score()) are needed.boost - The boost that is propagated by the parent queries.IOExceptionpublic String getField()
public int getNumDims()
public int getBytesPerDim()
public byte[] getLowerPoint()
public byte[] getUpperPoint()
public final int hashCode()
QueryQueryCache works properly.hashCode in class QueryQuery.equals(Object)public final boolean equals(Object o)
QueryQueryCache 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 QueryQuery.sameClassAs(Object),
Query.classHash()public final String toString(String field)
Queryfield 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-2018 Apache Software Foundation. All Rights Reserved.