Challenge: Aggregations
Test your aggregation writing skills in Elasticsearch.
We'll cover the following
Challenge
You are working with a dataset of movie information stored in Elasticsearch. The dataset includes several attributes for each movie, such as title
, lifetime_gross
, year
, studio
, rating
, runtime
, budget
, releaseDate
, voteAvg
, and voteCount
. Your task is to perform different aggregation queries in Elasticsearch.
The movies
index comprises several fields with their respective data types and purposes, including:
-
title
: Thistext
field stores the title of the movie. It allows full-text search capabilities, enabling users to efficiently search for movies based on their titles. -
lifetime_gross
: This field stores the total amount of money the movie has made in its lifetime. It is represented as aninteger
type, allowing for numeric calculations and range-based searches, such as finding movies with specific earnings. -
year
: Theyear
field represents the year the movie was released. It is stored as aninteger
data type. -
studio
: This field contains the name of the studio that produced the movie. It is stored as atext
type, enabling full-text search capabilities. -
rating
: Therating
field stores the rating of the movie (PG-13, R, etc.). It is stored as atext
type. -
runtime
: This field represents the length of the movie in minutes. It is stored as aninteger
. -
budget
: This field contains the budget of the movie in USD. It is stored as aninteger
. -
releaseDate
: This field indicates the date the movie was released. It is stored as adate
type. -
voteAvg
: This field represents the average rating of the movie from the users. It is stored as a floating-point number. -
voteCount
: This field stores the total number of votes the movie has received from users. It is stored as aninteger
type.
Get hands-on with 1400+ tech skills courses.