The GEOCONTAINS
field specifier (case sensitive) allows you to find documents that have a document field that describes a location region that contains a specified point or polygonal shape.
When you specify a polygon, GEOCONTAINS
matches polygons that wholly contain that polygon. When you specify a point, GEOCONTAINS
matches polygons that contain that point, and points that exactly match the point.
FieldText=GEOCONTAINS{POINT(coordX coordY)}:POSITION
or
FieldText=GEOCONTAINS{POLYGON((coordX coordY, coordX coordY,...))}:POSITION
coordX coordY
|
The coordinates for a point or one of the vertices of a polygon. For a polygon, specify an X/Y pair of coordinates for each vertex, working either clockwise or counterclockwise around the polygon. The polygon can be concave, but the edges cannot cross themselves. The polygon can also contain holes. You can specify coordinates with decimal numbers. |
POSITION
|
The document field containing the position information. This field must contain unified geospatial location information (that is, Well-known text format POINT or POLYGON definitions). You can specify multiple options for the location fields, in form |
NOTE: You can optimize this field specifier by configuring the position field with the
field property.
FieldText=GEOCONTAINS{POINT(0 0)}:LOCATION
This example matches all documents that define a region that contains the point (0,0). A document returns if it has a LOCATION
field that contains either a POINT
definition that matches the query point (that is, (0,0)), or a POLYGON
definition that contains it.
|