-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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 documentation for the new parent-join field #25227
Conversation
This commit adds the docs for the new parent-join field. It explains how to define, index and query this new field. Relates elastic#20257
} | ||
} | ||
} | ||
-------------------------------------------------- |
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.
I think it'd be easier to follow if you had a complete example with a single parent and child relationship and an example with more than one. The way it is now, when I read the document I start to have questions about how to use the field and then I have to scan below the ways to configure multiple parents before I get to the "how".
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.
I changed the examples in a088fcf with a focus on single parent/child relation.
// CONSOLE | ||
|
||
<1> The name for the field | ||
<2> `my_parent` is parent of `my_child`. |
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.
I think this bit deserves more explanation.
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.
Maybe it'd be more clear to index a parent with some children. Then it'd be more obvious how my_parent
and my_child
are used. It looks like my_parent
as a key has special meaning and I'm not used to that sort of thing in mappings. We do it all the time in queries though.
… levels relations to the end of the docs. Add links in the main types page
parent/child relation within documents of the same index. | ||
This field defines a set of possible relations within the documents, | ||
each relation being a parent name and a child name. | ||
A parent/child relation can be defined as follow: |
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.
s/follow/follows/
<1> `my_parent` is parent of `my_child` and `another_child` | ||
<2> `another_child` is parent of `grand_child | ||
|
||
Indexing a great child document requires a `routing` value equals |
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.
s/great/grand/
"my_join_field": { | ||
"type": "join", | ||
"my_parent": ["my_child", "another_child"], <1> | ||
"another_child": "grand_child" <2> |
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.
It isn't clear to me from reading the docs what this does. Does it make something like:
my_parent
/ |
/ |
my_child another_child
|
|
grand_child
?
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.
Maybe if you are going to build something this complex in a doc you should add the ascii art?
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.
I pushed 44de7ac with the example tree, I think the render is ok without the ascii art.
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.
LGTM
Thanks for the ascii art! |
Oh! The docs build didn't quite work for me locally. I think you have some mismatching callouts? |
-------------------------------------------------- | ||
// TESTRESPONSE[s/\.\.\./"timed_out": false, "took": $body.took, "_shards": $body._shards/] | ||
|
||
<1> This document belongs to the `my_parent` join |
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.
I think these are missing a callout in the example above.
Thanks @nik9000 and @martijnvg ! I'll backport to 5.x |
* Add documentation for the new parent-join field This commit adds the docs for the new parent-join field. It explains how to define, index and query this new field. Relates #20257
…y-context * 'master' of github.com:elastic/elasticsearch: (21 commits) [DOCS] Clarify expected availability of HDFS for the HDFS Repository (elastic#25220) Remove some redundant 140 character checkstyle suppressions [Docs] more fix for the parent-join docs [Docs] Fix cross reference for parent-join field More advices around search speed and disk usage. (elastic#25252) Add documentation for the new parent-join field (elastic#25227) [analysis-icu] Allow setting unicodeSetFilter (elastic#20814) Introduce translog size and age based retention policies (elastic#25147) Add needs methods for specific variables to Painless script context factories. (elastic#25267) Improves snapshot logging and snapshoth deletion error handling (elastic#25264) Add unit test for PathHierarchyTokenizerFactory (elastic#24984) Deprecate tribe service Moved more token filters to analysis-common module. [Test] Make sure that SearchAfterSortedDocQueryTests uses a single threaded searcher [DOCS] Defined es-test-dir and plugins-examples-dir in index.asciidoc. (elastic#25232) Test fix - removed superfluous assertion (elastic#25247) [Test] restore BWC for parent-join now that the new mapping format is in 5.x Add a section named "relations" in the ParentJoinFieldMapper (elastic#25248) test: Ported more OldIndexBackwardsCompatibilityIT tests to full cluster restart qa tests. (elastic#25173) fix: Sort Processor does not have proper behavior with targetField (elastic#25237) ...
This commit adds the docs for the new parent-join field.
It explains how to define, index and query this new field.
Relates #20257