Complete the code to create a date histogram aggregation with a daily interval.
{
"aggs": {
"sales_over_time": {
"date_histogram": {
"field": "sale_date",
"calendar_interval": "[1]"
}
}
}
}The calendar_interval set to day groups documents by each day.
Complete the code to set the time zone to 'UTC' in the date histogram aggregation.
{
"aggs": {
"sales_over_time": {
"date_histogram": {
"field": "sale_date",
"calendar_interval": "day",
"[1]": "UTC"
}
}
}
}The correct key to specify the time zone in a date histogram is time_zone.
Fix the error in the date histogram aggregation by completing the missing key for minimum document count.
{
"aggs": {
"sales_over_time": {
"date_histogram": {
"field": "sale_date",
"calendar_interval": "month",
"[1]": 0
}
}
}
}The correct key to include empty buckets is min_doc_count set to 0.
Fill both blanks to create a date histogram aggregation with a weekly interval.
{
"aggs": {
"weekly_sales": {
"date_histogram": {
"field": "sale_date",
"[1]": "[2]"
}
}
}
}The first blank is the key calendar_interval to set the interval, and the second blank is the value week for weekly grouping.
Fill all three blanks to create a date histogram aggregation with a monthly interval, time zone 'UTC', and minimum document count 0.
{
"aggs": {
"monthly_sales": {
"date_histogram": {
"[1]": "[2]",
"[3]": "UTC",
"min_doc_count": 0
}
}
}
}The first blank is the key calendar_interval, the second blank is the value month, and the third blank is the key time_zone.