-
Notifications
You must be signed in to change notification settings - Fork 2
aggregations
- Aggregation
-
CardinalityAgg ⇐
Aggregation
-
DateHistogramAgg ⇐
Aggregation
-
FilteredAgg ⇐
Aggregation
-
GeoDistanceAgg ⇐
Aggregation
-
MaxAgg ⇐
Aggregation
-
NestedAgg ⇐
Aggregation
-
RangeAgg ⇐
Aggregation
-
ScriptedMetricAgg ⇐
Aggregation
-
TermsAgg ⇐
Aggregation
Base elastic aggregation.
Kind: global class
Todo:: Add script option.
Param | Type | Default | Description |
---|---|---|---|
type | string |
Aggregation type, ex: "geo_bounds"; | |
[field] | string |
Set the aggregation field. Commonly used in simple aggs such as min or max. | |
[respectPostFilter] | boolean |
false |
flag to respect any post_filters by applying the filter to the aggregation. Defaults to false. |
Adds an Elasticsearch Aggregation object to the aggregation. Used to do aggregation on multiple items.
Kind: instance method of Aggregation
Param | Type | Description |
---|---|---|
aggObject | Aggregation |
Instance of Aggregation object. |
[aggName] | string |
Name of aggregation - optional. |
Attach a name to the aggregation object. Can be used when attaching the aggregation to a query. Convenience method to allow responsibility of the name to be given to the creator of the aggregation object. Can be accessed directly but won't show up during serialization.
Kind: instance method of Aggregation
Param | Type | Description |
---|---|---|
name | string |
Name of aggregation. |
Get the name of the aggregation object. Returns undefined if not set.
Kind: instance method of Aggregation
Returns: string
- Name of aggregation.
CardinalityAgg ⇐ Aggregation
Elastic metrics aggregation that calculates an approximate count of distinct values for a field.
Kind: global class
Extends: Aggregation
Param | Type | Default | Description |
---|---|---|---|
field | string |
Name of field to aggregate on. | |
[respectPostFilter] | boolean |
false |
flag to respect any post_filters by applying the filter to the aggregation. Defaults to false. |
Get the name of the aggregation object. Defaults to '{{field}}Cardinality'
Kind: instance method of CardinalityAgg
Overrides: getName
Returns: string
- Name of aggregation.
Adds an Elasticsearch Aggregation object to the aggregation. Used to do aggregation on multiple items.
Kind: instance method of CardinalityAgg
Param | Type | Description |
---|---|---|
aggObject | Aggregation |
Instance of Aggregation object. |
[aggName] | string |
Name of aggregation - optional. |
Attach a name to the aggregation object. Can be used when attaching the aggregation to a query. Convenience method to allow responsibility of the name to be given to the creator of the aggregation object. Can be accessed directly but won't show up during serialization.
Kind: instance method of CardinalityAgg
Param | Type | Description |
---|---|---|
name | string |
Name of aggregation. |
DateHistogramAgg ⇐ Aggregation
Elastic multi-bucket aggregation that groups by dates.
Kind: global class
Extends: Aggregation
Param | Type | Default | Description |
---|---|---|---|
field | string |
Name of field to aggregate on. | |
interval | string |
One of: year, quarter, month, week, day, hour, minute, or second | |
format | string |
Date format pattern link | |
[respectPostFilter] | false |
flag to respect any post_filters by applying the filter to the aggregation. Defaults to false. |
Get the name of the aggregation object.
Kind: instance method of DateHistogramAgg
Overrides: getName
Returns: string
- Name of aggregation. Defaults to '{{field}}DateHistogram'
Adds an Elasticsearch Aggregation object to the aggregation. Used to do aggregation on multiple items.
Kind: instance method of DateHistogramAgg
Param | Type | Description |
---|---|---|
aggObject | Aggregation |
Instance of Aggregation object. |
[aggName] | string |
Name of aggregation - optional. |
Attach a name to the aggregation object. Can be used when attaching the aggregation to a query. Convenience method to allow responsibility of the name to be given to the creator of the aggregation object. Can be accessed directly but won't show up during serialization.
Kind: instance method of DateHistogramAgg
Param | Type | Description |
---|---|---|
name | string |
Name of aggregation. |
FilteredAgg ⇐ Aggregation
Elastic Filtered Aggregation.
Kind: global class
Extends: Aggregation
Todo:: Inherit from Aggregation using node util when prototype funcs needed.
Param | Type | Description |
---|---|---|
innerAgg | Aggregation |
Aggregation object to be filtered. |
innerFilter |
Filter | Object
|
Filter object to apply to the innerAgg. |
[innerAggName] | string |
innerAgg name. Defaults to filteredAggName. |
Get the name of the aggregation object.
Kind: instance method of FilteredAgg
Overrides: getName
Returns: string
- Name of aggregation. Defers to innerAgg object.
Adds an Elasticsearch Aggregation object to the aggregation. Used to do aggregation on multiple items.
Kind: instance method of FilteredAgg
Param | Type | Description |
---|---|---|
aggObject | Aggregation |
Instance of Aggregation object. |
[aggName] | string |
Name of aggregation - optional. |
Attach a name to the aggregation object. Can be used when attaching the aggregation to a query. Convenience method to allow responsibility of the name to be given to the creator of the aggregation object. Can be accessed directly but won't show up during serialization.
Kind: instance method of FilteredAgg
Param | Type | Description |
---|---|---|
name | string |
Name of aggregation. |
GeoDistanceAgg ⇐ Aggregation
Elastic Geo Distance Aggregation.
Kind: global class
Extends: Aggregation
Todo:: Optionally pass in "ranges" array directly or provide 2 methods.
Param | Type | Default | Description |
---|---|---|---|
field | string |
Name of term to aggregate on. | |
origin |
Array.<number> | string
|
Elasticsearch geo_point type. {PS: Lat, Lon if string, [Lon, Lat] if array.} | |
unit | string |
Elasticsearch geo distance unit. @default 'm' | |
rings | int |
Number of concentric distance rings to bucket by. | |
ringRadiusInterval | number |
For each concetric ring, increase radius but this many units. | |
[respectPostFilter] | false |
flag to respect any post_filters by applying the filter to the aggregation. Defaults to false. |
Get the name of the aggregation object.
Kind: instance method of GeoDistanceAgg
Overrides: getName
Returns: string
- Name of aggregation. Defaults to '{{field}}GeoDistance'
Adds an Elasticsearch Aggregation object to the aggregation. Used to do aggregation on multiple items.
Kind: instance method of GeoDistanceAgg
Param | Type | Description |
---|---|---|
aggObject | Aggregation |
Instance of Aggregation object. |
[aggName] | string |
Name of aggregation - optional. |
Attach a name to the aggregation object. Can be used when attaching the aggregation to a query. Convenience method to allow responsibility of the name to be given to the creator of the aggregation object. Can be accessed directly but won't show up during serialization.
Kind: instance method of GeoDistanceAgg
Param | Type | Description |
---|---|---|
name | string |
Name of aggregation. |
MaxAgg ⇐ Aggregation
Elastic metrics aggregation that calculates the max value for the field.
Kind: global class
Extends: Aggregation
Param | Type | Default | Description |
---|---|---|---|
field | string |
Name of field to aggregate on. | |
[respectPostFilter] | false |
flag to respect any post_filters by applying the filter to the aggregation. Defaults to false. |
Get the name of the aggregation object.
Kind: instance method of MaxAgg
Overrides: getName
Returns: string
- Name of aggregation. Default to '{{field}}Max'
Adds an Elasticsearch Aggregation object to the aggregation. Used to do aggregation on multiple items.
Kind: instance method of MaxAgg
Param | Type | Description |
---|---|---|
aggObject | Aggregation |
Instance of Aggregation object. |
[aggName] | string |
Name of aggregation - optional. |
Attach a name to the aggregation object. Can be used when attaching the aggregation to a query. Convenience method to allow responsibility of the name to be given to the creator of the aggregation object. Can be accessed directly but won't show up during serialization.
Kind: instance method of MaxAgg
Param | Type | Description |
---|---|---|
name | string |
Name of aggregation. |
NestedAgg ⇐ Aggregation
Elastic Nested Aggregation. Wraps other aggregation instances.
Structure works around this issue
{nested: { path: 'pathstring' }, aggs: { 'innerAggName': { AGGREGATION } }}
Kind: global class
Extends: Aggregation
Todo:: allow multiple 'this.aggs'
Param | Type | Default | Description |
---|---|---|---|
innerAgg | Aggregation |
Inner aggregation object. | |
nestPath | string |
@optional path of nested document fields. If not provided, expects innerAgg to have a 'field' property and will infer. Ex: innerAgg field='x.y.z', path will be 'x.y'. | |
[innerAggName] | string |
@optional Aggregation name for inner agg. | |
[respectPostFilter] | false |
flag to respect any post_filters by applying the filter to the aggregation. Defaults to false. |
Get the name of the aggregation object.
Kind: instance method of NestedAgg
Overrides: getName
Returns: string
- Name of aggregation. Defers to innerAgg object.
Adds an Elasticsearch Aggregation object to the aggregation. Used to do aggregation on multiple items.
Kind: instance method of NestedAgg
Param | Type | Description |
---|---|---|
aggObject | Aggregation |
Instance of Aggregation object. |
[aggName] | string |
Name of aggregation - optional. |
Attach a name to the aggregation object. Can be used when attaching the aggregation to a query. Convenience method to allow responsibility of the name to be given to the creator of the aggregation object. Can be accessed directly but won't show up during serialization.
Kind: instance method of NestedAgg
Param | Type | Description |
---|---|---|
name | string |
Name of aggregation. |
RangeAgg ⇐ Aggregation
Elastic multi-bucket aggregation that groups by defined ranges.
Kind: global class
Extends: Aggregation
Param | Type | Default | Description |
---|---|---|---|
field | string |
Name of field to aggregate on. | |
ranges | Array.<Object> |
Array of objects containing 'to' and 'from' properties for each bucket. | |
[respectPostFilter] | false |
flag to respect any post_filters by applying the filter to the aggregation. Defaults to false. |
Get the name of the aggregation object.
Kind: instance method of RangeAgg
Overrides: getName
Returns: string
- Name of aggregation. Default to '{{field}}Range'
Adds an Elasticsearch Aggregation object to the aggregation. Used to do aggregation on multiple items.
Kind: instance method of RangeAgg
Param | Type | Description |
---|---|---|
aggObject | Aggregation |
Instance of Aggregation object. |
[aggName] | string |
Name of aggregation - optional. |
Attach a name to the aggregation object. Can be used when attaching the aggregation to a query. Convenience method to allow responsibility of the name to be given to the creator of the aggregation object. Can be accessed directly but won't show up during serialization.
Kind: instance method of RangeAgg
Param | Type | Description |
---|---|---|
name | string |
Name of aggregation. |
ScriptedMetricAgg ⇐ Aggregation
Elastic metrics aggregation that executes map-reduce style scripts.
Kind: global class
Extends: Aggregation
Param | Type | Default | Description |
---|---|---|---|
scripts | Object |
Scripts object containing map-reduce logic. | |
[respectPostFilter] | boolean |
false |
flag to respect any post_filters by applying the filter to the aggregation. Defaults to false. { 'init_script': 'script', 'map_script':'script', 'combine_script':'script', 'reduce_script':'script' } |
Adds an Elasticsearch Aggregation object to the aggregation. Used to do aggregation on multiple items.
Kind: instance method of ScriptedMetricAgg
Param | Type | Description |
---|---|---|
aggObject | Aggregation |
Instance of Aggregation object. |
[aggName] | string |
Name of aggregation - optional. |
Attach a name to the aggregation object. Can be used when attaching the aggregation to a query. Convenience method to allow responsibility of the name to be given to the creator of the aggregation object. Can be accessed directly but won't show up during serialization.
Kind: instance method of ScriptedMetricAgg
Param | Type | Description |
---|---|---|
name | string |
Name of aggregation. |
Get the name of the aggregation object. Returns undefined if not set.
Kind: instance method of ScriptedMetricAgg
Returns: string
- Name of aggregation.
TermsAgg ⇐ Aggregation
Elastic metrics aggregation that calculates an approximate count of distinct values for a field.
Kind: global class
Extends: Aggregation
Param | Type | Default | Description |
---|---|---|---|
field | string |
Name of field to aggregate on. | |
[size] | int |
Number of buckets to return. Size 0 returns all buckets. | |
[respectPostFilter] | false |
flag to respect any post_filters by applying the filter to the aggregation. Defaults to false. |
Get the name of the aggregation object.
Kind: instance method of TermsAgg
Overrides: getName
Returns: string
- Name of aggregation. Default to '{{field}}Terms'
Adds an Elasticsearch Aggregation object to the aggregation. Used to do aggregation on multiple items.
Kind: instance method of TermsAgg
Param | Type | Description |
---|---|---|
aggObject | Aggregation |
Instance of Aggregation object. |
[aggName] | string |
Name of aggregation - optional. |
Attach a name to the aggregation object. Can be used when attaching the aggregation to a query. Convenience method to allow responsibility of the name to be given to the creator of the aggregation object. Can be accessed directly but won't show up during serialization.
Kind: instance method of TermsAgg
Param | Type | Description |
---|---|---|
name | string |
Name of aggregation. |
Gets the path to the parent object of the desired property. EX: 'w.x.y.z' returns 'w.x.y' as a string.
Kind: global function