-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chapter43_part5: /404_Parent_Child/60_Children_agg.asciidoc #278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
[[children-agg]] | ||
=== Children Aggregation | ||
=== 子文档聚合 | ||
|
||
Parent-child supports a | ||
http://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-children-aggregation.html[`children` aggregation] as ((("aggregations", "children aggregation")))((("children aggregation")))((("parent-child relationship", "children aggregation")))a direct analog to the `nested` aggregation discussed in | ||
<<nested-aggregation>>. A parent aggregation (the equivalent of | ||
`reverse_nested`) is not supported. | ||
|
||
This example demonstrates how we could determine the favorite hobbies of our | ||
employees by country: | ||
在父-子文档中,支持 | ||
http://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-children-aggregation.html[子文档聚合],这一点和((("aggregations", "children aggregation")))((("children aggregation")))((("parent-child relationship", "children aggregation"))) <<nested-aggregation>> 类似。但是,对于父文档的聚合查询是不支持的(和 `reverse_nested` 类似)。 | ||
|
||
如下查询展示了如何在不同国家下,按照雇员爱好的维度进行聚合查询: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 改为下面的是否更通顺一些 |
||
[source,json] | ||
------------------------- | ||
GET /company/branch/_search | ||
|
@@ -37,7 +33,6 @@ GET /company/branch/_search | |
} | ||
} | ||
------------------------- | ||
<1> The `country` field in the `branch` documents. | ||
<2> The `children` aggregation joins the parent documents with | ||
their associated children of type `employee`. | ||
<3> The `hobby` field from the `employee` child documents. | ||
<1> `country` 是 `branch` 的一个字段。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. <1> |
||
<2> 对子文档的聚合查询结果和对父文档的聚合查询结果,是通过 `employee` type 关联起来的。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 子文档聚合查询通过 |
||
<3> `hobby` 是 `employee` 子文档的一个字段。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
父子中间的这个 - 感觉没啥意义,英文是为了分割单词吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok,按照意见修改