Understanding aggregations
Aggregations are collections of data that is stored in buckets. Aggregations have grown from the facets module of Elasticsearch, which allows fast querying and easy aggregation of data. Aggregations are used for building analytical information over the documents stored. They are used for real-time data analysis purposes. There are different types of aggregation which have a specified purpose with specific output, which can be classified into the following categories.
Bucket aggregations
In this type of aggregation, buckets are created to store various documents and are used for grouping the documents stored; every bucket is associated with a key and document criterion. The decision-making that decides which bucket will contain a document matching its criterion can be based either on the value of a specific field or any other parameter. Whenever aggregation is done, all bucket criterion are evaluated to decide which documents match the criterion of each bucket and...