In this post we cover Elasticsearch Aggregations. Elasticsearch Aggregation API's main task allows you to summarize, calculate, and group the data in near real time. An important feature here is that our aggregations can implement sub-aggregations, which in turn implement more sub-aggregations. You can implement these sub-aggregations as much as needed. You can use aggregations in a variety of actions, from building analytical reports, to getting real-time analysis of data and taking quick actions. This allows for a flexible API.

The aggregation functionality is completely different from search and enables you to ask sophisticated questions to the data. Let's practice with this tool.

Note: If you have no experience with aggregations in Elastic, please read this article first.

Keep reading

It can be challenging to get the right outcomes from your Elasticsearch aggregations. But it's possible to get precise results with tokenization, exact mappings, and a custom analyzer.

In this article, we explain some of the subtleties that are inherent in the design of the Elasticsearch analyzer. We help you understand a common cause of erroneous result sets. Then we show you two methods for improving the results and getting them to be entirely accurate. We also provide many resources to help you gain proficiency in ES aggregations.

Keep reading

Elasticsearch continues to evolve. The big news recently is that release 2.0 is around the corner. Pipeline aggregations is perhaps the most interesting feature set that will be available in this upcoming release. This will be an extension of the existing ES aggregations framework, and it will provide for a number of computation types that users can perform on top of the standard aggregations results.

In this article, we give a brief overview of this ES feature extension, direct you to tutorials on aggregations, and provide links to more information.

Keep reading

This is a continuation of our extensive blog series on Elasticsearch scripting, which includes tutorials and example scripts for sorting, filtering, and scoring. In our previous article, we went through a basic tutorial on performing aggregations in Elasticsearch using scripts.

In this tutorial we move on to more advanced operations: computing term frequencies, reshaping the results of extended_stats aggregations, and implementing scripted_metric aggregations.

Keep reading

This is a continuation of our long-running blog series on Elasticsearch scripting, which includes tutorials and example scripts for sorting, filtering, and scoring. In this article, we move on to various scripting options that are available for managing ES aggregations.

A developer often doesn't get the expected results when using default aggregations. There are also limitations with the basic aggregation features. This is the case, for example, if we want to alter the offset values for a histogram. Since Elasticsearch doesn't provide this native capability, we use scripts to get the results we want. We also cover several other aggregation tasks using scripts.

Keep reading

Many facets have a directly equivalent aggregation, and migration is as straightforward as replacing the keyword “facets” with “aggregations” or “aggs” in your query. For facets that do not have an equivalent aggregation, the Elasticsearch reference provides us with basic examples for migrating these facets to their aggregation counterparts. Two of these, query facets and facet filters, will be referenced in this post.

Keep reading