Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Elasticsearch Essentials

You're reading from   Elasticsearch Essentials Harness the power of ElasticSearch to build and manage scalable search and analytics solutions with this fast-paced guide

Arrow left icon
Product type Paperback
Published in Jan 2016
Publisher
ISBN-13 9781784391010
Length 240 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (12) Chapters Close

Preface 1. Getting Started with Elasticsearch FREE CHAPTER 2. Understanding Document Analysis and Creating Mappings 3. Putting Elasticsearch into Action 4. Aggregations for Analytics 5. Data Looks Better on Maps: Master Geo-Spatiality 6. Document Relationships in NoSQL World 7. Different Methods of Search and Bulk Operations 8. Controlling Relevancy 9. Cluster Scaling in Production Deployments 10. Backups and Security Index

Metric aggregations


As explained in the previous sections, metric aggregations allow you to find out the statistical measurement of the data, which includes the following:

  • Computing basic statistics

    • Computing in a combined way: stats aggregation

    • Computing separately : min, max, sum, value_count, aggregations

  • Computing extended statistics: extended_stats aggregation

  • Computing distinct counts: cardinality aggregation

    Note

    Metric aggregations are fundamentally categorized in two forms:

    • single-value metric: min, max, sum, value_count, avg, and cardinality aggregations

    • multi-value metric: stats and extended_stats aggregations

Computing basic stats

The basic statistics include: min, max, sum, count, and avg. These statistics can be computed in the following two ways and can only be performed on numeric fields.

Combined stats

All the stats mentioned previously can be calculated with a single aggregation query.

Python example

query = {
 "aggs": {
   "follower_counts_stats": {
     "stats": {
       "field...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image