View Source ExlasticSearch.Aggregation (exlasticsearch v2.2.3)

Elasticsearch aggregation building functions

Summary

Functions

The source for a composite aggregation, eg composite_source(:age, :terms, field: :age)

Includes a given aggregation within the aggregation with name name

create a new aggregation specification

Convert to the es representation of the aggregation

Bucket a query by a given term

Return the top results for a query or aggregation scope

Types

t()

@type t() :: %ExlasticSearch.Aggregation{
  aggregations: term(),
  nested: term(),
  options: term()
}

Functions

composite(agg, name, sources, opts \\ [])

A composite aggregation

composite_source(name, type, opts)

The source for a composite aggregation, eg composite_source(:age, :terms, field: :age)

nest(agg, name, nest)

Includes a given aggregation within the aggregation with name name

new()

create a new aggregation specification

realize(map)

Convert to the es representation of the aggregation

terms(agg, name, options)

Bucket a query by a given term

top_hits(agg, name, options)

Return the top results for a query or aggregation scope

with_nested(aggregation, nested, key)