ES权威指南_04_aggs_01 High-Level Concepts
来源:互联网 发布:golang和go的区别 编辑:程序博客网 时间:2024/06/09 20:20
https://www.elastic.co/guide/en/elasticsearch/guide/current/aggregations.html
With aggs, we zoom out to get an overview of our data. Instead of looking for individual docs, we want to analyze and summarize our complete set of data:
- 最大、最小、平均、中间、最受欢迎
Aggs execute quickly and are near real-time, just like search.This is extremely powerful for reporting and dashboards, you can visualize your data in real time, allowing you to respond immediately.
Finally, aggs operate alongside search requests. This means you can both search/filter docs and perform analytics at the same time, on the same data, in a single request.
To master aggregations, you need to understand only two main concepts:
SELECT COUNT(color) FROM tableGROUP BY color
- Buckets –>group:分组
Collections of docs that meet a criterion - Metrics –>count(),sum() , max():统计
Statistics calculated on the docs in a bucket
1 Buckets
As aggs are executed, the values inside each doc are evaluated to determine whether they match a bucket’s criteria. If they match, the doc is placed inside the bucket and the agg continues.
Buckets can also be nested inside other buckets.
Elasticsearch has a variety of buckets, which allow you to partition docs in many ways (by hour, by most-popular terms, by age ranges, by geographical location, and more). But fundamentally they all operate on the same principle: partitioning documents based on criteria.
2 Metrics
Bucketing is the means to an end: it provides a way to group docs in a way that you can calculate interesting metrics.
Most metrics are simple mathematical operations (for example, min, mean, max, and sum) that are calculated using the doc values.In practical terms, metrics allow you to calculate quantities such as the average salary, or the maximum sale price, or the 95th percentile for query latency.
3 Combining the Two
t may even have multiple buckets nested inside other buckets.
- ES权威指南_04_aggs_01 High-Level Concepts
- High Level Networking Concepts
- ES权威指南_05_Geolocation_02 Geohashes
- ES权威指南_01_get start_10 Index Management
- ES权威指南_04_aggs_05 Scoping Aggs
- ES权威指南_04_aggs_07 Sorting Multivalue Buckets
- ES权威指南_04_aggs_11 Closing Thoughts
- ES权威指南_05_Geolocation_01 Geo Points
- ES权威指南_05_Geolocation_03 Geo Aggs
- ES权威指南_05_Geolocation_04 Geo Shapes
- ES权威指南_07_admin monitor deploy_01 Monitoring
- ES权威指南_01_get start_01 You Know, for Search…
- ES权威指南_01_get start_03 Data In, Data Out
- ES权威指南_01_get start_04 Distributed Document Store
- ES权威指南_01_get start_05 Searching—The Basic Tools
- ES权威指南_01_get start_06 Mapping and Analysis
- ES权威指南_01_get start_07 Full-Body Search
- ES权威指南_01_get start_08 Sorting and Relevance
- 计数器的CPU
- 0002-大话数据——(数据模型)
- Android存储路径问题
- Ajax中解析Json的两种方法详解
- oracle权限
- ES权威指南_04_aggs_01 High-Level Concepts
- 字符串匹配的KMP算法彻底理解
- ES权威指南_04_aggs_02 Aggs Test-Drive(学习方法:测试驱动)
- SQL2005 数据库 附加失败
- spring与RabbitMQ整合 消费者消费不到消息 重启才能消费到的问题解决
- 访问原理及HTTP协议
- html 盒子模型基础(单位,边框,内边距,外边距)(一)
- centos中忘记mysql密码
- python绘图小记