ejsGeoDistanceAggregation

A multi-bucket aggregation that works on geo_point fields and conceptually works very similar to the range aggregation. The user can define a point of origin and a set of distance range buckets. The aggregation evaluate the distance of each document value from the origin point and determines the buckets it belongs to based on the ranges (a document belongs to a bucket if the distance between the document and the origin falls within the distance range of the bucket).

Module

 GeoDistanceAggregation

GeoDistanceAggregation ( name )

Aggregation that works on geo_point fields and conceptually works very similar to the range aggregation.


Parameters
name <String> The name which be used to refer to this aggregation.

Method Summary

Returns Name Description
String_type()The type of ejs object. For internal use only.
Objectagg(agg)Add a nesated aggregation. This method can be called multiple times in order to set multiple nested aggregations what will be executed at the same time as the parent aggregation. Alias for the aggregation method.
Objectaggregation(agg)Add a nesated aggregation. This method can be called multiple times in order to set multiple nested aggregations what will be executed at the same time as the parent aggregation.
Objectcenter(p)Sets the point of origin from where distances will be measured. Same as origin.
ObjectdistanceType(type)How to compute the distance. Valid values are: plane, arc, sloppy_arc, and factor.
Objectfield(field)

Sets the field to gather terms from.

Objectkeyed(trueFalse)Enable the response to be returned as a keyed object where the key is the bucket interval.
Objectorigin(p)Sets the point of origin from where distances will be measured.
Objectpoint(p)Sets the point of origin from where distances will be measured. Same as origin.
Objectrange(from,to,key)Adds a range to the list of exsiting range expressions.
StringtoJSON()

Retrieves the internal agg object. This is typically used by internal API functions so use with caution.

Objectunit(unit)Sets the distance unit. Valid values are: in, yd, ft, km, NM, mm, cm, mi, and m.

Method Detail

 _type

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

Returns
the type of object

 agg

Object agg ( agg )
Add a nesated aggregation. This method can be called multiple times in order to set multiple nested aggregations what will be executed at the same time as the parent aggregation. Alias for the aggregation method.

Parameters
agg <Aggregation> Any valid Aggregation object.
Returns
returns this so that calls can be chained.

 aggregation

Object aggregation ( agg )
Add a nesated aggregation. This method can be called multiple times in order to set multiple nested aggregations what will be executed at the same time as the parent aggregation.

Parameters
agg <Aggregation> Any valid Aggregation object.
Returns
returns this so that calls can be chained.

 center

Object center ( p )
Sets the point of origin from where distances will be measured. Same as origin.

Parameters
p <GeoPoint> A valid GeoPoint object
Returns
returns this so that calls can be chained.

 distanceType

Object distanceType ( type )
How to compute the distance. Valid values are: plane, arc, sloppy_arc, and factor.

Parameters
type <String> The execution type as a string.
Returns
returns this so that calls can be chained.

 field

Object field ( field )

Sets the field to gather terms from.


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

 keyed

Object keyed ( trueFalse )
Enable the response to be returned as a keyed object where the key is the bucket interval.

Parameters
trueFalse <Boolean> to enable keyed response or not
Returns
returns this so that calls can be chained.

 origin

Object origin ( p )
Sets the point of origin from where distances will be measured.

Parameters
p <GeoPoint> A valid GeoPoint object
Returns
returns this so that calls can be chained.

 point

Object point ( p )
Sets the point of origin from where distances will be measured. Same as origin.

Parameters
p <GeoPoint> A valid GeoPoint object
Returns
returns this so that calls can be chained.

 range

Object range ( from, to, key )
Adds a range to the list of exsiting range expressions.

Parameters
from <String> The start value, use null to ignore
to <String> The end value, use null to ignore.
key <String> Optional key/bucket name for keyed responses.
Returns
returns this so that calls can be chained.

 toJSON

String toJSON ( )

Retrieves the internal agg object. This is typically used by internal API functions so use with caution.


Returns
returns this object's internal object.

 unit

Object unit ( unit )
Sets the distance unit. Valid values are: in, yd, ft, km, NM, mm, cm, mi, and m.

Parameters
unit <Number> the unit of distance measure.
Returns
returns this so that calls can be chained.

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo