Filtering your data when running an aggregation is important to ensure you have the correct results being reported. This video shows a couple common ways to filter the results of an aggregation query.
- [Instructor] Let's go back and think about…how we could actually filter these aggregations…and we'll start by showing a count of accounts by state,…just like we did a second ago.…So we'll say GET bank/account/_search.…From there we'll do size of zero,…and we'll do our aggregations, aggs,…and we'll call this states.…
It'll be terms.…In the field will be state.keyword.…We'll remove the size limiting here.…Run that guy, and this is nothing new.…We just looked at this.…So this is the equivalent of using a match_all.…In fact, if I wanted to, I could just add that here.…So if I added a query,…I could do match_all and essentially get those same results.…I'm not filtering at all.…So the aggregations work inside inside of the context,…and so when I looked at aggregations a second ago,…I didn't bring this up because its add a whole another layer…to this question of how to use this API.…
So what if instead of running a match_all query,…we wanted to see these values for just accounts…in California?…Well, I could run match and this time I'll do state.keyword…
In this course, join Ben Sullins as he dives into the inner workings of Elasticsearch combined with Kibana. Ben provides an overview of the architecture, and then goes over the different deployment methods, and how to best structure your data. From there, he demonstrates how to query data, and how to work with Kibana to present your insights.
- Reviewing key Elasticsearch concepts
- Running Elasticsearch in the cloud and locally
- Bulk loading data
- Setting up mappings of data types
- Querying data
- Running basic aggregations
- Creating visualizations and dashboards in Kibana