Package org.apache.lucene.document
Class XYShapeBoundingBoxQuery
- java.lang.Object
-
- org.apache.lucene.search.Query
-
- org.apache.lucene.document.ShapeQuery
-
- org.apache.lucene.document.XYShapeBoundingBoxQuery
-
public class XYShapeBoundingBoxQuery extends ShapeQuery
Finds all previously indexed cartesian shapes that intersect the specified bounding box.The field must be indexed using
XYShape.createIndexableFields(java.lang.String, org.apache.lucene.geo.XYPolygon)
added per document.
-
-
Field Summary
Fields Modifier and Type Field Description private XYRectangle
rectangle
(package private) Component2D
rectangle2D
-
Fields inherited from class org.apache.lucene.document.ShapeQuery
field, queryRelation
-
-
Constructor Summary
Constructors Constructor Description XYShapeBoundingBoxQuery(java.lang.String field, ShapeField.QueryRelation queryRelation, double minX, double maxX, double minY, double maxY)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Override and implement query instance equivalence properly in a subclass.protected boolean
equalsTo(java.lang.Object o)
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 triangleprotected 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 seeShapeQuery.relateRangeToQuery(byte[], byte[], org.apache.lucene.document.ShapeField.QueryRelation)
andShapeQuery.relateRangeToQuery(byte[], byte[], org.apache.lucene.document.ShapeField.QueryRelation)
java.lang.String
toString(java.lang.String field)
Prints a query to a string, withfield
assumed to be the default field and omitted.-
Methods inherited from class org.apache.lucene.document.ShapeQuery
createWeight, getField, getQueryRelation, relateRangeToQuery, visit
-
Methods inherited from class org.apache.lucene.search.Query
classHash, rewrite, sameClassAs, toString
-
-
-
-
Field Detail
-
rectangle2D
final Component2D rectangle2D
-
rectangle
private final XYRectangle rectangle
-
-
Constructor Detail
-
XYShapeBoundingBoxQuery
public XYShapeBoundingBoxQuery(java.lang.String field, ShapeField.QueryRelation queryRelation, double minX, double maxX, double minY, double maxY)
-
-
Method Detail
-
relateRangeBBoxToQuery
protected PointValues.Relation relateRangeBBoxToQuery(int minXOffset, int minYOffset, byte[] minTriangle, int maxXOffset, int maxYOffset, byte[] maxTriangle)
Description copied from class:ShapeQuery
relates an internal node (bounding box of a range of triangles) to the target query Note: logic is specific to query type seeShapeQuery.relateRangeToQuery(byte[], byte[], org.apache.lucene.document.ShapeField.QueryRelation)
andShapeQuery.relateRangeToQuery(byte[], byte[], org.apache.lucene.document.ShapeField.QueryRelation)
- Specified by:
relateRangeBBoxToQuery
in classShapeQuery
-
queryMatches
protected boolean queryMatches(byte[] t, ShapeField.DecodedTriangle scratchTriangle, ShapeField.QueryRelation queryRelation)
returns true if the query matches the encoded triangle- Specified by:
queryMatches
in classShapeQuery
-
queryWithin
protected Component2D.WithinRelation queryWithin(byte[] t, ShapeField.DecodedTriangle scratchTriangle)
Description copied from class:ShapeQuery
Return the within relationship between the query and the indexed shape.- Specified by:
queryWithin
in classShapeQuery
-
equals
public boolean equals(java.lang.Object o)
Description copied from class:Query
Override and implement query instance equivalence properly in a subclass. This is required so thatQueryCache
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.- Overrides:
equals
in classShapeQuery
- See Also:
Query.sameClassAs(Object)
,Query.classHash()
-
equalsTo
protected boolean equalsTo(java.lang.Object o)
- Overrides:
equalsTo
in classShapeQuery
-
hashCode
public int hashCode()
Description copied from class:Query
Override and implement query hash code properly in a subclass. This is required so thatQueryCache
works properly.- Overrides:
hashCode
in classShapeQuery
- See Also:
Query.equals(Object)
-
-