public class XYShapeBoundingBoxQuery extends Query
The field must be indexed using
XYShape.createIndexableFields(java.lang.String, org.apache.lucene.geo.XYPolygon)
added per document.
Constructor and Description |
---|
XYShapeBoundingBoxQuery(String field,
ShapeField.QueryRelation queryRelation,
double minX,
double maxX,
double minY,
double maxY) |
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(Object o)
Override and implement query instance equivalence properly in a subclass.
|
protected boolean |
equalsTo(Object o) |
String |
getField()
returns the field name
|
ShapeField.QueryRelation |
getQueryRelation()
returns the query relation
|
int |
hashCode()
Override and implement query hash code properly in a subclass.
|
protected boolean |
queryMatches(byte[] t,
ShapeField.DecodedTriangle scratchTriangle,
ShapeField.QueryRelation queryRelation)
returns true if the query matches the encoded triangle
|
protected Component2D.WithinRelation |
queryWithin(byte[] t,
ShapeField.DecodedTriangle scratchTriangle)
Return the within relationship between the query and the indexed shape.
|
protected 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
ShapeQuery.relateRangeToQuery(byte[], byte[], org.apache.lucene.document.ShapeField.QueryRelation) and ShapeQuery.relateRangeToQuery(byte[], byte[], org.apache.lucene.document.ShapeField.QueryRelation) |
protected PointValues.Relation |
relateRangeToQuery(byte[] minTriangle,
byte[] maxTriangle,
ShapeField.QueryRelation queryRelation)
relates a range of triangles (internal node) to the query
|
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
public XYShapeBoundingBoxQuery(String field, ShapeField.QueryRelation queryRelation, double minX, double maxX, double minY, double maxY)
protected PointValues.Relation relateRangeBBoxToQuery(int minXOffset, int minYOffset, byte[] minTriangle, int maxXOffset, int maxYOffset, byte[] maxTriangle)
ShapeQuery.relateRangeToQuery(byte[], byte[], org.apache.lucene.document.ShapeField.QueryRelation)
and ShapeQuery.relateRangeToQuery(byte[], byte[], org.apache.lucene.document.ShapeField.QueryRelation)
protected boolean queryMatches(byte[] t, ShapeField.DecodedTriangle scratchTriangle, ShapeField.QueryRelation queryRelation)
protected Component2D.WithinRelation queryWithin(byte[] t, ShapeField.DecodedTriangle scratchTriangle)
public 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.Query.sameClassAs(Object)
,
Query.classHash()
protected boolean equalsTo(Object o)
public int hashCode()
Query
QueryCache
works properly.Query.equals(Object)
public String toString(String field)
Query
field
assumed to be the
default field and omitted.protected PointValues.Relation relateRangeToQuery(byte[] minTriangle, byte[] maxTriangle, ShapeField.QueryRelation queryRelation)
public void visit(QueryVisitor visitor)
Query
public final Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost)
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.public String getField()
public ShapeField.QueryRelation getQueryRelation()
Copyright © 2000–2020 The Apache Software Foundation. All rights reserved.