public abstract class PointInSetQuery extends Query
IntPoint
,
is contained in the specified set.
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.newSetQuery()
for
fields indexed with IntPoint
.
PointValues
Modifier and Type | Class and Description |
---|---|
private class |
PointInSetQuery.MergePointVisitor
Essentially does a merge sort, only collecting hits when the indexed point and query point are the same.
|
private class |
PointInSetQuery.SinglePointVisitor
IntersectVisitor that queries against a highly degenerate shape: a single point.
|
static class |
PointInSetQuery.Stream
Iterator of encoded point values.
|
Modifier and Type | Field and Description |
---|---|
(package private) int |
bytesPerDim |
(package private) java.lang.String |
field |
(package private) int |
numDims |
(package private) PrefixCodedTerms |
sortedPackedPoints |
(package private) int |
sortedPackedPointsHashCode |
Modifier | Constructor and Description |
---|---|
protected |
PointInSetQuery(java.lang.String field,
int numDims,
int bytesPerDim,
PointInSetQuery.Stream packedPoints)
The
packedPoints iterator must be in sorted order. |
Modifier and Type | Method and Description |
---|---|
Weight |
createWeight(IndexSearcher searcher,
ScoreMode scoreMode,
float boost)
Expert: Constructs an appropriate Weight implementation for this query.
|
boolean |
equals(java.lang.Object other)
Override and implement query instance equivalence properly in a subclass.
|
private boolean |
equalsTo(PointInSetQuery other) |
int |
getBytesPerDim() |
java.lang.String |
getField() |
int |
getNumDims() |
java.util.Collection<byte[]> |
getPackedPoints() |
int |
hashCode()
Override and implement query hash code properly in a subclass.
|
protected abstract java.lang.String |
toString(byte[] value)
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 PrefixCodedTerms sortedPackedPoints
final int sortedPackedPointsHashCode
final java.lang.String field
final int numDims
final int bytesPerDim
protected PointInSetQuery(java.lang.String field, int numDims, int bytesPerDim, PointInSetQuery.Stream packedPoints)
packedPoints
iterator must be in sorted order.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 java.util.Collection<byte[]> getPackedPoints()
public java.lang.String getField()
public int getNumDims()
public int getBytesPerDim()
public final int hashCode()
Query
QueryCache
works properly.hashCode
in class Query
Query.equals(Object)
public final boolean equals(java.lang.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()
private boolean equalsTo(PointInSetQuery other)
public final 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[] value)
Query.toString()
.
The default implementation encodes the individual byte values.value
- single value, never null