Skip to content

Conversation

@weiqiangyuan
Copy link

No description provided.


This example demonstrates how we could determine the favorite hobbies of our
employees by country:
在父-子文档中,支持

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

父子中间的这个 - 感觉没啥意义,英文是为了分割单词吧

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok,按照意见修改

在父-子文档中,支持
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` 类似)。

如下查询展示了如何在不同国家下,按照雇员爱好的维度进行聚合查询:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改为下面的是否更通顺一些
我们通过下面的例子来演示按照国家维度查看最受雇员欢迎的业余爱好。

<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` 的一个字段。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<1> countrybranch 文档 的一个字段。

their associated children of type `employee`.
<3> The `hobby` field from the `employee` child documents.
<1> `country` 是 `branch` 的一个字段。
<2> 对子文档的聚合查询结果和对父文档的聚合查询结果,是通过 `employee` type 关联起来的。

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

子文档聚合查询通过 employee 类型的子文档将其父文档聚合在一起。

@rockybean
Copy link

LGTM

@medcl
Copy link
Member

medcl commented Oct 21, 2016

LGTM

@medcl medcl merged commit 712085a into elasticsearch-cn:cn Oct 22, 2016
tangmisi pushed a commit to tangmisi/elasticsearch-definitive-guide that referenced this pull request Oct 31, 2016
…earch-cn#278)

* 完成Parent-Child第5部分的翻译

* revise according comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants