Parent-child supports a children
aggregation as a direct analog to the nested
aggregation discussed in Nested Aggregations. A parent aggregation (the equivalent of reverse_nested
) is not supported.
부모-자식은, Nested Aggregations에서 언급했던, nested
aggregation과 정확히 닮은, children aggregation를 지원한다. parent aggregation(reverse_nested
와 비슷한)는 지원되지 않는다.
This example demonstrates how we could determine the favorite hobbies of our employees by country:
이 예제는 나라별로 직원들이 좋아하는 취미를 알아내는 방법을 나타낸다.
GET /company/branch/_search { "size" : 0, "aggs": { "country": { "terms": { "field": "country" }, "aggs": { "employees": { "children": { "type": "employee" }, "aggs": { "hobby": { "terms": { "field": "hobby" } } } } } } } }
| |
| |
|
'2.X > 6. Modeling Your Data' 카테고리의 다른 글
6-3-3. Finding Parents by Their Children (0) | 2017.09.23 |
---|---|
6-3-4. Finding Children by Their Parents (0) | 2017.09.23 |
6-3-6. Grandparents and Grandchildren (0) | 2017.09.23 |
6-3-7. Practical Considerations (0) | 2017.09.23 |
6-4. Designing for Scale (0) | 2017.09.23 |