abstract class LatLonShapeQuery extends Query
LatLonShapeBoundingBoxQuery and LatLonShapePolygonQuery
Note: this class implements the majority of the INTERSECTS, WITHIN, DISJOINT relation logic| Modifier and Type | Class and Description |
|---|---|
private static class |
LatLonShapeQuery.RelationScorerSupplier
utility class for implementing constant score logic specific to INTERSECT, WITHIN, and DISJOINT
|
| Modifier and Type | Field and Description |
|---|---|
(package private) java.lang.String |
field
field name
|
(package private) LatLonShape.QueryRelation |
queryRelation
query relation
disjoint:
CELL_OUTSIDE_QUERY
intersects: CELL_CROSSES_QUERY,
within: CELL_WITHIN_QUERY |
| Modifier | Constructor and Description |
|---|---|
protected |
LatLonShapeQuery(java.lang.String field,
LatLonShape.QueryRelation queryType) |
| 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 o)
Override and implement query instance equivalence properly in a subclass.
|
protected boolean |
equalsTo(java.lang.Object o) |
java.lang.String |
getField()
returns the field name
|
LatLonShape.QueryRelation |
getQueryRelation()
returns the query relation
|
int |
hashCode()
Override and implement query hash code properly in a subclass.
|
protected abstract boolean |
queryMatches(byte[] triangle,
int[] scratchTriangle,
LatLonShape.QueryRelation queryRelation)
returns true if the provided triangle matches the query
|
protected abstract PointValues.Relation |
relateRangeBBoxToQuery(int minXOffset,
int minYOffset,
byte[] minTriangle,
int maxXOffset,
int maxYOffset,
byte[] maxTriangle)
relates an internal node (bounding box of a range of triangles) to the target query
Note: logic is specific to query type
see
relateRangeToQuery(byte[], byte[], org.apache.lucene.document.LatLonShape.QueryRelation) and relateRangeToQuery(byte[], byte[], org.apache.lucene.document.LatLonShape.QueryRelation) |
protected PointValues.Relation |
relateRangeToQuery(byte[] minTriangle,
byte[] maxTriangle,
LatLonShape.QueryRelation queryRelation)
relates a range of triangles (internal node) to the query
|
private static PointValues.Relation |
transposeRelation(PointValues.Relation r)
transpose the relation; INSIDE becomes OUTSIDE, OUTSIDE becomes INSIDE, CROSSES remains unchanged
|
void |
visit(QueryVisitor visitor)
Recurse through the query tree, visiting any child queries
|
final java.lang.String field
final LatLonShape.QueryRelation queryRelation
CELL_OUTSIDE_QUERY
intersects: CELL_CROSSES_QUERY,
within: CELL_WITHIN_QUERYprotected LatLonShapeQuery(java.lang.String field,
LatLonShape.QueryRelation queryType)
protected abstract PointValues.Relation relateRangeBBoxToQuery(int minXOffset, int minYOffset, byte[] minTriangle, int maxXOffset, int maxYOffset, byte[] maxTriangle)
relateRangeToQuery(byte[], byte[], org.apache.lucene.document.LatLonShape.QueryRelation) and relateRangeToQuery(byte[], byte[], org.apache.lucene.document.LatLonShape.QueryRelation)protected abstract boolean queryMatches(byte[] triangle,
int[] scratchTriangle,
LatLonShape.QueryRelation queryRelation)
protected PointValues.Relation relateRangeToQuery(byte[] minTriangle, byte[] maxTriangle, LatLonShape.QueryRelation queryRelation)
public void visit(QueryVisitor visitor)
Querypublic final Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws java.io.IOException
QueryOnly implemented by primitive queries, which re-write to themselves.
createWeight in class QueryscoreMode - How the produced scorers will be consumed.boost - The boost that is propagated by the parent queries.java.io.IOExceptionpublic java.lang.String getField()
public LatLonShape.QueryRelation getQueryRelation()
public int hashCode()
QueryQueryCache works properly.hashCode in class QueryQuery.equals(Object)public boolean equals(java.lang.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()protected boolean equalsTo(java.lang.Object o)
private static PointValues.Relation transposeRelation(PointValues.Relation r)