2.X/4. Aggregations

4-01. High-Level Concepts

drscg 2017. 9. 24. 11:38

Like the query DSL, aggregations have a composable syntax: independent units of functionality can be mixed and matched to provide the custom behavior that you need. This means that there are only a few basic concepts to learn, but nearly limitless combinations of those basic components.

query DSL과 마찬가지로, aggregation은 구성이 가능한 문법을 가지고 있다. 필요한 사용자 정의 동작을 제공하기 위해, 독립적인 기능 단위를 혼합하고 일치될 수 있다. 즉, 배워야 할 몇 가지 기본적인 개념만 있다. 그러나, 이런 기본 구성 요소의 조합은 거의 무한하다.

To master aggregations, you need to understand only two main concepts:

aggregation에 익숙해지기 위해서, 두 가지 주요 개념을 이해해야 한다.

Buckets

Collections of documents that meet a criterion

기준을 만족하는 document의 집합

Metrics

Statistics calculated on the documents in a bucket

bucket의 document에서 계산되는 통계

That’s it! Every aggregation is simply a combination of one or more buckets and zero or more metrics. To translate into rough SQL terms:

그렇다. 모든 aggregation은 하나 이상의 bucket과, 0개 이상의 metric의 단순한 조합이다. SQL로 옮기면 아래와 같다.

SELECT COUNT(color) 
FROM table
GROUP BY color 

COUNT(color) 는 metric과 동등하다.

GROUP BY color 는 bucket과 동일하다.

Buckets are conceptually similar to grouping in SQL, while metrics are similar to COUNT()SUM()MAX(), and so forth.

bucket은 SQL의 grouping과 개념적으로 유사하고, metric은 COUNT()SUM()MAX() 등과 유사하다.

Let’s dig into both of these concepts and see what they entail.

이런 개념 모두를 파헤쳐서 , 그들이 가지고 있는 것을 알아보자.

'2.X > 4. Aggregations' 카테고리의 다른 글

4. Aggregations  (0) 2017.09.24
4-01-1. Buckets  (0) 2017.09.24
4-01-2. Metrics  (0) 2017.09.24
4-01-3. Combining the Two  (0) 2017.09.24
4-02. Aggregation Test-Drive  (0) 2017.09.24