aggregation

This block is part of the query group and was last modified in core v13.0.4.

Connection Type

This block connects from a query type block. Make sure to connect this block to the appropriate left-hand side connection.

aggregation v13.0.4

Build an aggregation on the given query.

In pins 5
  • Name required
    value
  • Type required
    aggregation
  • Sub. aggregation
    query

    Suggestions: query_aggregation

  • Range Filter
    query

    Suggestions: query_bool_range_gt query_bool_range_gte query_bool_range_lte query_bool_range_lt

  • Meta Data v13.0.4
    object

    To associate custom metadata with an aggregation

Out pins 1
  • query
    query

Builds an aggregation object {"aggs": {name: type-definition}}; an empty name pin or an unwired/nil type pin outputs an empty object {}. A non-nil meta pin is added as "meta" and a sub_agg object is deep-merged into the aggregation body. A filter object adds a sibling bucket_selector aggregation named "<name>_filter" whose script joins one "params.keyName <op> <value>" condition per filter key (gt/lt/lte/gte); any other filter key falls through to a >= comparison using the gte entry's value.

A typical wiring for aggregation: value feeds the name pin; cardinality feeds the type pin; the query out pin feeds search.

Studio canvas example for the aggregation block: typical wiring for aggregation.

Commonly used with

In production blueprints, this block is most often wired together with:

  • search: this block feeds into it. searches in the given storage based on a query.
  • value: feeds into this block. Simply returns the provided value.
  • cardinality: feeds into this block. Counts the approximate number of distinct values for the specified field.
  • terms: feeds into this block. Performs term-based grouping, allowing aggregation on specified criteria.
  • count on field: feeds into this block. Counts the occurrences of values in the specified numeric, date, or value field.

Used in these guides

These documentation pages use or explain this block:

Version history

Introduced in v13.0.4.


Back to query Return to the main group to view all sub-groups Back to query Return to the group to view all blocks within this group