2.X/6. Modeling Your Data
6-3-5. Children Aggregation
drscg
2017. 9. 23. 14:31
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" } } } } } } } }
| |
| |
|