Skip to content
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

Add children aggregation documentation #7645

Merged
merged 16 commits into from
Oct 14, 2024
Merged

Add children aggregation documentation #7645

merged 16 commits into from
Oct 14, 2024

Conversation

vagimeli
Copy link
Contributor

@vagimeli vagimeli commented Jul 8, 2024

Description

Closes content gaps for the following bucket aggregations:
Auto-interval date histogram
Children
Composite
Parent
Rare terms

Issues Resolved

#4293

Version

Current version

Frontend features

If you're submitting documentation for an OpenSearch Dashboards feature, add a video that shows how a user will interact with the UI step by step. A voiceover is optional.

Checklist

  • By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and subject to the Developers Certificate of Origin.
    For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@vagimeli vagimeli self-assigned this Jul 8, 2024

The `authors` aggregation groups the documents by the `author.keyword` field. Within each author group, we have a `children` aggregation that looks at the associated posts. Inside the `posts` aggregation, another `children` aggregation looks at the comments associated with each post. Within the `comments` aggregation, the `value_count` aggregation counts the number of comments for each post.

#### Example
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Technical reviewer: Please confirm this example is relevant to an OpenSearch user. I tested the example using Dev Tools. If another example is more appropriate, please replace the draft example with your example. Thank you.

Copy link
Contributor Author

@vagimeli vagimeli Jul 9, 2024

Choose a reason for hiding this comment

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

@msfroh @bowenlan-amzn @sandeshkr419 Would one of you be available to technical review this PR? The doc team is closing content gaps for aggregations and need a technical review before we can published the doc. Please note that I used internal tools to assist in code example generation and Dev Tools to test those examples. Thank you

Copy link
Member

Choose a reason for hiding this comment

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

I only see the search request and response here, can you provide what data you ingest?

Copy link
Contributor Author

@vagimeli vagimeli Sep 30, 2024

Choose a reason for hiding this comment

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

@bowenlan-amzn I used the sample data sets in OpenSearch Dashboards. Feel free to update with relevant examples for OpenSearch users.

Copy link
Member

Choose a reason for hiding this comment

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

Using the sample data sets is fine, I think just mention that here and this is good.

Signed-off-by: Melissa Vagi <[email protected]>

The `children` aggregation connects parent documents with their related child documents. This allows you to analyze relationships between different types of data in a single query, rather than having to run multiple queries and combine the results yourself.

For example, if you have a parent-child relationship between authors, posts, and comments, you can analyze the relationships between the data different types (`authors`, `posts`, and `comments`) in a single query, without having to run multiple queries and combine the results manually.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bowenlan-amzn Does this clarify the sample index and data comment?

Copy link
Member

Choose a reason for hiding this comment

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

I think you need to provide the requests you used to index the data that correspond to below search request and response.

@vagimeli vagimeli added 4 - Doc review PR: Doc review in progress and removed 3 - Tech review PR: Tech review in progress labels Oct 8, 2024
Copy link
Collaborator

@natebower natebower left a comment

Choose a reason for hiding this comment

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

@vagimeli Please see my comments and changes and let me know if you have any questions. Thanks!

_aggregations/bucket/children.md Outdated Show resolved Hide resolved
_aggregations/bucket/children.md Outdated Show resolved Hide resolved
_aggregations/bucket/children.md Outdated Show resolved Hide resolved
For example, if you have a parent-child relationship between authors, posts, and comments, you can analyze the relationships between the data different types (`authors`, `posts`, and `comments`) in a single query, without having to run multiple queries and combine the results manually.

The `authors` aggregation groups the documents by the `author.keyword` field. Within each author group, we have a `children` aggregation that looks at the associated posts. Inside the `posts` aggregation, another `children` aggregation looks at the comments associated with each post. Within the `comments` aggregation, the `value_count` aggregation counts the number of comments for each post.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Above: Please replace both instances of the phrasal verb "looks at" with a more precise verb. What do the aggregations actually do?

_aggregations/bucket/children.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@Naarcha-AWS Naarcha-AWS left a comment

Choose a reason for hiding this comment

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

LGTM

@vagimeli vagimeli removed the 4 - Doc review PR: Doc review in progress label Oct 11, 2024
Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Melissa Vagi <[email protected]>
vagimeli and others added 3 commits October 11, 2024 13:05
Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Melissa Vagi <[email protected]>
Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Melissa Vagi <[email protected]>
Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Melissa Vagi <[email protected]>
@vagimeli vagimeli merged commit a013ae2 into main Oct 14, 2024
6 checks passed
@vagimeli vagimeli deleted the children-aggregation branch October 14, 2024 23:17
leanneeliatra pushed a commit to leanneeliatra/opensearch-documentation-website-forl that referenced this pull request Oct 17, 2024
* Add children aggregation documentation

Signed-off-by: Melissa Vagi <[email protected]>

* Add children aggregation documentation

Signed-off-by: Melissa Vagi <[email protected]>

* Add children aggregation documentation

Signed-off-by: Melissa Vagi <[email protected]>

* Add content gaps to list

Signed-off-by: Melissa Vagi <[email protected]>

* Update examples to include data samples

Signed-off-by: Melissa Vagi <[email protected]>

* Update _aggregations/bucket/children.md

Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Melissa Vagi <[email protected]>

* Update _aggregations/bucket/children.md

Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Melissa Vagi <[email protected]>

* Update _aggregations/bucket/children.md

Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Melissa Vagi <[email protected]>

* Update _aggregations/bucket/children.md

Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Melissa Vagi <[email protected]>

* Update _aggregations/bucket/index.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update _aggregations/bucket/index.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update _aggregations/bucket/children.md

Signed-off-by: Melissa Vagi <[email protected]>

* Fix dead links

Signed-off-by: Melissa Vagi <[email protected]>

---------

Signed-off-by: Melissa Vagi <[email protected]>
Co-authored-by: Naarcha-AWS <[email protected]>
Co-authored-by: Nathan Bower <[email protected]>
leanneeliatra pushed a commit to leanneeliatra/opensearch-documentation-website-forl that referenced this pull request Oct 17, 2024
* Add children aggregation documentation

Signed-off-by: Melissa Vagi <[email protected]>

* Add children aggregation documentation

Signed-off-by: Melissa Vagi <[email protected]>

* Add children aggregation documentation

Signed-off-by: Melissa Vagi <[email protected]>

* Add content gaps to list

Signed-off-by: Melissa Vagi <[email protected]>

* Update examples to include data samples

Signed-off-by: Melissa Vagi <[email protected]>

* Update _aggregations/bucket/children.md

Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Melissa Vagi <[email protected]>

* Update _aggregations/bucket/children.md

Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Melissa Vagi <[email protected]>

* Update _aggregations/bucket/children.md

Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Melissa Vagi <[email protected]>

* Update _aggregations/bucket/children.md

Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Melissa Vagi <[email protected]>

* Update _aggregations/bucket/index.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update _aggregations/bucket/index.md

Signed-off-by: Melissa Vagi <[email protected]>

* Update _aggregations/bucket/children.md

Signed-off-by: Melissa Vagi <[email protected]>

* Fix dead links

Signed-off-by: Melissa Vagi <[email protected]>

---------

Signed-off-by: Melissa Vagi <[email protected]>
Co-authored-by: Naarcha-AWS <[email protected]>
Co-authored-by: Nathan Bower <[email protected]>
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.

5 participants