bucket-aggregations

bucket-aggregations

Methods

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

Assemble a termsAggregation fragment.
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 - can be a dotted path like publisher.name
size number the number of buckets to return
Returns:
a query fragment
Type
Object
Example
termsAggregation({ name: '@type', field: '@type.keyword', size: 12 })