ejsGeoShapeFilter

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

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

Module

 GeoShapeFilter

GeoShapeFilter ( )
A Filter 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.
Objectcache(trueFalse)Enable or disable caching of the filter
ObjectcacheKey(key)Sets the cache key.
Objectfield(f)Sets the field to filter against.
ObjectindexedShape(indexedShape)Sets the indexed shape. Use this if you already have shape definitions already indexed.
Objectname(name)Sets the filter name.
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.

ObjecttoJSON()Returns the filter object.

Method Detail

 _type

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

Returns
the type of object

 cache

Object cache ( trueFalse )
Enable or disable caching of the filter

Parameters
trueFalse <Boolean> True to cache the filter, false otherwise.
Returns
returns this so that calls can be chained.

 cacheKey

Object cacheKey ( key )
Sets the cache key.

Parameters
key <String> the cache key as a string.
Returns
returns this so that calls can be chained.

 field

Object field ( f )
Sets the field to filter 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.

 name

Object name ( name )
Sets the filter name.

Parameters
name <String> A name for the filter.
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

Object toJSON ( )
Returns the filter object.

Returns
filter object

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo