December 2017
Intermediate to advanced
434 pages
10h 29m
English
Bucket aggregations segment the data in question (defined by the query context) into various buckets identified by the buckets key. Bucket aggregation evaluates each document in the context by deciding which bucket it falls into. At the end, bucket aggregation has a set of distinct buckets with their respective bucket keys and documents that fall into those buckets.
For people who come from an SQL background, a query that has GROUP BY, such as the following query, is doing this:
SELECT column1, count(*) FROM table1 GROUP BY column1;
This query divides the table by the different values of column 1 and returns a count of documents within each value of column 1. This is an example of bucket aggregation. There are many different ...
Read now
Unlock full access