ejsDateRangeAggregation

A range aggregation that is dedicated for date values. The main difference between this aggregation and the normal range aggregation is that the from and to values can be expressed in Date Math expressions, and it is also possible to specify a date format by which the from and to response fields will be returned. Note that this aggregration includes the from value and excludes the to value for each range.

Note that this aggregration includes the from value and excludes the to value for each range.

Module

 DateRangeAggregation

DateRangeAggregation ( name )

Aggregation that is dedicated for date value ranges.


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.
Objectfield(field)

Sets the field to operate on.

Objectformat(f)Sets the date format expression.
Objectkeyed(trueFalse)Enable the response to be returned as a keyed object where the key is the bucket interval.
Objectlang(language)The script language being used.
Objectparams(p)Sets parameters that will be applied to the script. Overwrites any existing params.
Objectrange(from,to,key)Adds a range to the list of exsiting range expressions.
Objectscript(scriptCode)Allows you generate or modify the terms/values using a script.
ObjectscriptFile(scriptFile)Allows you generate or modify the terms/values using a script.
ObjectscriptId(scriptId)Allows you generate or modify the terms/values using a script.
StringtoJSON()

Retrieves the internal agg 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

 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.

 field

Object field ( field )

Sets the field to operate on.


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

 format

Object format ( f )
Sets the date format expression.

Parameters
f <String> the format string
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.

 lang

Object lang ( language )
The script language being used.

Parameters
language <String> The language of the script.
Returns
returns this so that calls can be chained.

 params

Object params ( p )
Sets parameters that will be applied to the script. Overwrites any existing params.

Parameters
p <Object> An object where the keys are the parameter name and values are the parameter value.
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.

 script

Object script ( scriptCode )
Allows you generate or modify the terms/values using a script.

Parameters
scriptCode <String> A valid script string to execute.
Returns
returns this so that calls can be chained.

 scriptFile

Object scriptFile ( scriptFile )
Allows you generate or modify the terms/values using a script.

Parameters
scriptFile <String> A valid script file to execute.
Returns
returns this so that calls can be chained.

 scriptId

Object scriptId ( scriptId )
Allows you generate or modify the terms/values using a script.

Parameters
scriptId <String> A valid script id to execute.
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.

Request

Queries

Filters

Aggregations

Facets

Suggesters

Geo