Data Aggregation in Elasticsearch: A Guide
2 min readAug 14, 2023
The wonderful world of Elasticsearch offers a plethora of options for data analysis. In this guide, we’ll walk you through a hands-on lab where you’ll aggregate data and glean insights from a 3-node Elasticsearch cluster.
The Scenario
You’re a data analyst at an online banking company. The company utilizes a 3-node Elasticsearch cluster as a NoSQL database to manage active accounts. Your mission is to answer a series of questions using the Elasticsearch search API without fetching any documents, focusing strictly on aggregation results.
Questions:
- How many unique employers exist among account holders?
- How many accounts are there in each of the 50 US states?
- What’s the average account balance for each of the 50 US states, and which state boasts the highest average balance?
Tools & Resources:
- Elasticsearch Cluster Nodes
- Master-1
- Data-1
- Data-2 - Kibana Instance: On the master-1 node.