metrics-aggregations

metrics-aggregations

Methods

# (static) cardinalityAggregation(params) → {Object}

Assemble a cardinalityAggregation fragment. That is - count the uniq occurences in a field.
Parameters:
Name Type Description
params Object
Properties
Name Type Description
name string the label for the aggregation
field string the field on which to aggregate and count - can be a dotted path like publisher.field
Returns:
a query fragment
Type
Object
Example
cardinalityAggregation({ name: '@type', field: '@type.keyword' })