ejsDateHistogramAggregation

A multi-bucket aggregation similar to the histogram except it can only be applied on date values. Since dates are represented in elasticsearch internally as long values, it is possible to use the normal histogram on dates as well, though accuracy will be compromised. The reason for this is in the fact that time based intervals are not fixed (think of leap years and on the number of days in a month). For this reason, we need a special support for time based data. From a functionality perspective, this histogram supports the same features as the normal histogram. The main difference is that the interval can be specified by date/time expressions.

Module

 DateHistogramAggregation

DateHistogramAggregation ( name )

Aggregation similar to the histogram except it can only be applied on date values.


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.
ObjectextendedBounds(min,max)Set's the range/bounds for the histogram aggregation. Useful when you want to include buckets that might be outside the bounds of indexed documents.
Objectformat(f)Sets the format expression for the terms. Use for number or date formatting
Objectinterval(i)Sets the histogram interval. Buckets are generated based on this interval value.
Objectkeyed(trueFalse)Enable the response to be returned as a keyed object where the key is the bucket interval.
ObjectminDocCount(num)Only return terms that match more than a configured number of hits.
Objectorder(order,direction)Sets order for the aggregated values.
ObjectpostOffset(offset)Set the post-rouding offset.
ObjectpostZone(tz)Set the post-rouding date time zone.
ObjectpreOffset(offset)Set the pre-rouding offset.
ObjectpreZone(tz)Set the pre-rouding date time zone.
ObjectpreZoneAdjustLargeInterval(trueFalse)Set to true to apply interval adjusts to day and above intervals.
ObjecttimeZone(tz)Set the date time zone.
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.

 extendedBounds

Object extendedBounds ( min, max )
Set's the range/bounds for the histogram aggregation. Useful when you want to include buckets that might be outside the bounds of indexed documents.

Parameters
min <String | Long> The start bound / minimum bound value
max <String | Long> The end bound / maximum bound value
Returns
returns this so that calls can be chained.

 format

Object format ( f )
Sets the format expression for the terms. Use for number or date formatting

Parameters
f <String> the format string
Returns
returns this so that calls can be chained.

 interval

Object interval ( i )
Sets the histogram interval. Buckets are generated based on this interval value.

Parameters
i <String> The interval
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.

 minDocCount

Object minDocCount ( num )
Only return terms that match more than a configured number of hits.

Parameters
num <Integer> The numer of minimum number of hits.
Returns
returns this so that calls can be chained.

 order

Object order ( order, direction )
Sets order for the aggregated values.

Parameters
order <String> The order string.
direction <String> The sort direction, asc or desc.
Returns
returns this so that calls can be chained.

 postOffset

Object postOffset ( offset )
Set the post-rouding offset.

Parameters
offset <String> the offset.
Returns
returns this so that calls can be chained.

 postZone

Object postZone ( tz )
Set the post-rouding date time zone.

Parameters
tz <String> the time zone.
Returns
returns this so that calls can be chained.

 preOffset

Object preOffset ( offset )
Set the pre-rouding offset.

Parameters
offset <String> the offset.
Returns
returns this so that calls can be chained.

 preZone

Object preZone ( tz )
Set the pre-rouding date time zone.

Parameters
tz <String> the time zone.
Returns
returns this so that calls can be chained.

 preZoneAdjustLargeInterval

Object preZoneAdjustLargeInterval ( trueFalse )
Set to true to apply interval adjusts to day and above intervals.

Parameters
trueFalse <Boolean> adjust large intervals or not
Returns
returns this so that calls can be chained.

 timeZone

Object timeZone ( tz )
Set the date time zone.

Parameters
tz <String> the time zone.
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