ejsGeoShapeQuery

Efficient querying of documents containing shapes indexed using the geo_shape type.

Much like the geo_shape type, the geo_shape query uses a grid square representation of the query shape to find those documents which have shapes that relate to the query shape in a specified way. In order to do this, the field being queried must be of geo_shape type. The query will use the same PrefixTree configuration as defined for the field.

Module

 GeoShapeQuery

GeoShapeQuery ( )
A Query to find documents with a geo_shapes matching a specific shape.

Method Summary

Returns Name Description
String_type()The type of ejs object. For internal use only.
Objectboost(boost)Sets the boost value for documents matching the Query.
Objectfield(f)Sets the field to query against.
ObjectindexedShape(indexedShape)Sets the indexed shape. Use this if you already have shape definitions already indexed.
Objectrelation(indexedShape)Sets the shape relation type. A relationship between a Query Shape and indexed Shapes that will be used to determine if a Document should be matched or not. Valid values are: intersects, disjoint, and within.
Objectshape(shape)Sets the shape
Objectstrategy(strategy)

Sets the spatial strategy.

Valid values are:

recursive - default, recursively traverse nodes in the spatial prefix tree. This strategy has support for searching non-point shapes.
term - uses a large TermsFilter on each node in the spatial prefix tree. It only supports the search of indexed Point shapes.

This is an advanced setting, use with care.

StringtoJSON()Retrieves the internal query object. This is typically used by internal API functions so use with caution.

Method Detail

 _type

String _type ( )
The type of ejs object. For internal use only.

Returns
the type of object

 boost

Object boost ( boost )
Sets the boost value for documents matching the Query.

Parameters
boost <Number> A positive double value.
Returns
returns this so that calls can be chained.

 field

Object field ( f )
Sets the field to query against.

Parameters
f <String> A valid field name.
Returns
returns this so that calls can be chained.

 indexedShape

Object indexedShape ( indexedShape )
Sets the indexed shape. Use this if you already have shape definitions already indexed.

Parameters
indexedShape <String> A valid IndexedShape object.
Returns
returns this so that calls can be chained.

 relation

Object relation ( indexedShape )
Sets the shape relation type. A relationship between a Query Shape and indexed Shapes that will be used to determine if a Document should be matched or not. Valid values are: intersects, disjoint, and within.

Parameters
indexedShape <String> A valid IndexedShape object.
Returns
returns this so that calls can be chained.

 shape

Object shape ( shape )
Sets the shape

Parameters
shape <String> A valid Shape object.
Returns
returns this so that calls can be chained.

 strategy

Object strategy ( strategy )

Sets the spatial strategy.

Valid values are:

recursive - default, recursively traverse nodes in the spatial prefix tree. This strategy has support for searching non-point shapes.
term - uses a large TermsFilter on each node in the spatial prefix tree. It only supports the search of indexed Point shapes.

This is an advanced setting, use with care.


Since
elasticsearch 0.90
Parameters
strategy <String> The strategy as a string.
Returns
returns this so that calls can be chained.

 toJSON

String toJSON ( )
Retrieves the internal query object. This is typically used by internal API functions so use with caution.

Returns
returns this object's internal query property.

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo