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 documentation for the new parent-join field #25227

Merged
merged 7 commits into from
Jun 16, 2017

Conversation

jimczi
Copy link
Contributor

@jimczi jimczi commented Jun 14, 2017

This commit adds the docs for the new parent-join field.
It explains how to define, index and query this new field.

Relates #20257

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
}
}
}
--------------------------------------------------
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 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".

Copy link
Contributor Author

@jimczi jimczi Jun 14, 2017

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`.
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 this bit deserves more explanation.

Copy link
Member

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:
Copy link
Member

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
Copy link
Member

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>
Copy link
Member

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

?

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

LGTM

@nik9000
Copy link
Member

nik9000 commented Jun 15, 2017

Thanks for the ascii art!

@nik9000
Copy link
Member

nik9000 commented Jun 15, 2017

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
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 these are missing a callout in the example above.

@jimczi jimczi removed the review label Jun 16, 2017
@jimczi jimczi merged commit ccb3c9a into elastic:master Jun 16, 2017
@jimczi jimczi deleted the parent_join_docs branch June 16, 2017 09:13
@jimczi
Copy link
Contributor Author

jimczi commented Jun 16, 2017

Thanks @nik9000 and @martijnvg ! I'll backport to 5.x

jimczi added a commit that referenced this pull request Jun 16, 2017
* 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
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Jun 16, 2017
…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)
  ...
@clintongormley clintongormley added :Search/Search Search-related issues that do not fall into other categories and removed :Parent/Child labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>docs General docs changes :Search/Search Search-related issues that do not fall into other categories v5.6.0 v6.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants