From ba2ce48191cde55774fb5f26d6c1ea417866463b Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Wed, 14 Jun 2017 19:34:33 +0200 Subject: [PATCH 1/6] 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 --- .../mapping/types/parent-join.asciidoc | 363 ++++++++++++++++++ .../search/request/inner-hits.asciidoc | 132 ++++--- 2 files changed, 441 insertions(+), 54 deletions(-) create mode 100644 docs/reference/mapping/types/parent-join.asciidoc diff --git a/docs/reference/mapping/types/parent-join.asciidoc b/docs/reference/mapping/types/parent-join.asciidoc new file mode 100644 index 0000000000000..3908d9f2b29a2 --- /dev/null +++ b/docs/reference/mapping/types/parent-join.asciidoc @@ -0,0 +1,363 @@ +[[mapping-parent-join-field]] +=== `join` datatype + +The `join` datatype is a special field that creates +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 single parent/child relation can be defined as follow: + +[source,js] +-------------------------------------------------- +PUT my_index +{ + "mappings": { + "doc": { + "properties": { + "my_join_field": { <1> + "type": "join", + "my_parent": "my_child" <2> + } + } + } + } +} +-------------------------------------------------- +// CONSOLE + +<1> The name for the field +<2> `my_parent` is parent of `my_child`. + +It is also possible to define multiple children for a single parent: + +[source,js] +-------------------------------------------------- +PUT my_index +{ + "mappings": { + "doc": { + "properties": { + "my_join_field": { + "type": "join", + "my_parent": ["my_child", "another_child"] <1> + } + } + } + } +} +-------------------------------------------------- +// CONSOLE + +<1> `my_parent` is parent of `my_child`. + +... and multiple levels of parent/child: + +[source,js] +-------------------------------------------------- +PUT my_index +{ + "mappings": { + "doc": { + "properties": { + "my_join_field": { + "type": "join", + "my_parent": ["my_child", "another_child"], <1> + "another_child": "grand_child" <2> + } + } + } + } +} +-------------------------------------------------- +// CONSOLE + +<1> `my_parent` is parent of `my_child` and `another_child` +<2> `another_child` is parent of `grand_child + +To index a parent `my_parent` document the name of the relation +must be added to the `_source`: + +[source,js] +-------------------------------------------------- +PUT my_index/doc/1?refresh +{ + "text": "This is a parent document", + "my_join_field": "my_parent" <1> +} +-------------------------------------------------- +// CONSOLE +// TEST[continued] + +<1> This document is a `my_parent` document. + +When indexing a child, the name of the relation as well as the parent id of the document +must be added in the `_source`. + + +It is required to index the lineage of a parent in the same shard so you must +always route child documents using their greater parent id. +For instance the following index a child document with a `routing` value +equals to the `id` of the parent: + +[source,js] +-------------------------------------------------- +PUT my_index/doc/2?routing=1&refresh <1> +{ + "text": "This is a child document", + "my_join_field": { + "name": "my_child", <2> + "parent": "1" <3> + } +} +-------------------------------------------------- +// CONSOLE +// TEST[continued] + +<1> This child document must be on the same shard than its parent +<2> This is `my_child` document +<3> The parent id of this child document + +Similarly indexing a great child document requires a `routing` value equals +to the grand-parent (the greater parent of the lineage): + +[source,js] +-------------------------------------------------- +PUT my_index/doc/3?routing=1&refresh <1> +{ + "text": "This is a grand child document", + "my_join_field": { + "name": "grand_child", + "parent": "2" <2> + } +} +-------------------------------------------------- +// CONSOLE +// TEST[continued] + +<1> This child document must be on the same shard than its grandparent and parent +<2> The parent id of this document (must points to an `another_child` document) + +==== Parent-child restrictions + +* Only one `join` field is allowed per index mapping. +* An element can have multiple children but only one parent. +* Parent and child documents must be indexed on the same shard. + This means that the same `routing` value needs to be provided when + <>, <>, or <> + a child document. +* It is possible to add a new relation to an existing `join` field. +* It is also possible to add a child to an existing element + but only if the element is already a parent. + +==== Searching with parent-join + +The parent-join creates one field to index the name of the relation +within the document (`my_parent`, `my_child`, ...). +It also creates one field per parent/child relation. The name of this field is +the name of the `join` field followed by `#` and the name of the parent in the relation. +So for instance for the `my_parent` => [`my_child`, `another_child`] relation, +the `join` field creates an additional field named `my_join_field#my_parent`. +This field contains the parent `_id` that the document links to +if the document is a child (`my_child` or `another_child`) and the `_id` of +document if it's a parent (`my_parent`). +When searching an index that contains a `join` field, these two fields are always +returned in the search response: + +[source,js] +-------------------------- +GET my_index/_search +{ + "query": { + "match_all": {} + }, + "sort": ["_id"] +} +-------------------------- +// CONSOLE +// TEST[continued] + +[source,js] +-------------------------------------------------- +{ + ..., + "hits": { + "total": 3, + "max_score": null, + "hits": [ + { + "_index": "my_index", + "_type": "doc", + "_id": "1", + "_score": null, + "_source": { + "text": "This is a parent document", + "my_join_field": "my_parent" + }, + "fields": { + "my_join_field": [ + "my_parent" <1> + ] + }, + "sort": [ + "1" + ] + }, + { + "_index": "my_index", + "_type": "doc", + "_id": "2", + "_score": null, + "_routing": "1", + "_source": { + "text": "This is a child document", + "my_join_field": { + "name": "my_child", + "parent": "1" + } + }, + "fields": { + "my_join_field": [ + "my_child" <2> + ], + "my_join_field#my_parent": [ + "1" <3> + ] + }, + "sort": [ + "2" + ] + }, + { + "_index": "my_index", + "_type": "doc", + "_id": "3", + "_score": null, + "_routing": "1", + "_source": { + "text": "This is a grand child document", + "my_join_field": { + "name": "grand_child", + "parent": "2" + } + }, + "fields": { + "my_join_field": [ + "grand_child" <4> + ], + "my_join_field#another_child": [ + "2" <5> + ] + }, + "sort": [ + "3" + ] + } + ] + } +} +-------------------------------------------------- +// TESTRESPONSE[s/\.\.\./"timed_out": false, "took": $body.took, "_shards": $body._shards/] + +<1> This is a parent document in the `my_parent` context +<2> This is child document in the `my_child` context +<3> The linked parent id for the child document +<4> This is child document in the `grand_child` context +<5> The linked parent id for the child document + +==== Parent-join queries and aggregations + +See the <> and +<> queries, +the <> aggregation, +and <> for more information. + +The value of the `join` field is accessible in aggregations +and scripts, and may be queried with the +<>: + +[source,js] +-------------------------- +GET my_index/_search +{ + "query": { + "parent_id": { <1> + "type": "my_child", + "id": "1" + } + }, + "aggs": { + "parents": { + "terms": { + "field": "my_join_field#my_parent", <2> + "size": 10 + } + } + }, + "script_fields": { + "parent": { + "script": { + "source": "doc['my_join_field#my_parent']" <3> + } + } + } +} +-------------------------- +// CONSOLE +// TEST[continued] + +<1> Querying the `parent id` field (also see the <> and the <>) +<2> Aggregating on the `parent id` field (also see the <> aggregation) +<3> Accessing the parent id` field in scripts + + +==== Global ordinals + +The `join` field uses <> to speed up joins. +Global ordinals need to be rebuilt after any change to a shard. The more +parent id values are stored in a shard, the longer it takes to rebuild the +global ordinals for the `join` field. + +Global ordinals, by default, are built eagerly: if the index has changed, +global ordinals for the `join` field will be rebuilt as part of the refresh. +This can add significant time to the refresh. However most of the times this is the +right trade-off, otherwise global ordinals are rebuilt when the first parent-join +query or aggregation is used. This can introduce a significant latency spike for +your users and usually this is worse as multiple global ordinals for the `join` +field may be attempt rebuilt within a single refresh interval when many writes +are occurring. + +When the `join` field is used infrequently and writes occur frequently it may +make sense to disable eager loading: + +[source,js] +-------------------------------------------------- +PUT my_index +{ + "mappings": { + "doc": { + "properties": { + "my_join_field": { + "type": "join", + "my_parent": "my_child", + "eager_global_ordinals": false + } + } + } + } +} +-------------------------------------------------- +// CONSOLE + +The amount of heap used by global ordinals can be checked per parent relation +as follows: + +[source,sh] +-------------------------------------------------- +# Per-index +GET _stats/fielddata?human&fields=my_join_field#my_parent + +# Per-node per-index +GET _nodes/stats/indices/fielddata?human&fields=my_join_field#my_parent +-------------------------------------------------- +// CONSOLE +// TEST[continued] diff --git a/docs/reference/search/request/inner-hits.asciidoc b/docs/reference/search/request/inner-hits.asciidoc index 2ad06233d7d8c..00edaba79c6c3 100644 --- a/docs/reference/search/request/inner-hits.asciidoc +++ b/docs/reference/search/request/inner-hits.asciidoc @@ -1,7 +1,7 @@ [[search-request-inner-hits]] === Inner hits -The <> and <> features allow the return of documents that +The < and <> features allow the return of documents that have matches in a different scope. In the parent/child case, parent documents are returned based on matches in child documents or child documents are returned based on matches in parent documents. In the nested case, documents are returned based on matches in nested inner objects. @@ -103,11 +103,11 @@ PUT test/doc/1?refresh "comments": [ { "author": "kimchy", - "text": "comment text" + "number": 1 }, { "author": "nik9000", - "text": "words words words" + "number": 2 } ] } @@ -118,7 +118,7 @@ POST test/_search "nested": { "path": "comments", "query": { - "match": {"comments.text" : "words"} + "match": {"comments.number" : 2} }, "inner_hits": {} <1> } @@ -137,29 +137,29 @@ An example of a response snippet that could be generated from the above search r ..., "hits": { "total": 1, - "max_score": 0.9651416, + "max_score": 1.0, "hits": [ { "_index": "test", "_type": "doc", "_id": "1", - "_score": 0.9651416, + "_score": 1.0, "_source": ..., "inner_hits": { "comments": { <1> "hits": { "total": 1, - "max_score": 0.9651416, + "max_score": 1.0, "hits": [ { "_nested": { "field": "comments", "offset": 1 }, - "_score": 0.9651416, + "_score": 1.0, "_source": { "author": "nik9000", - "text": "words words words" + "number": 2 } } ] @@ -425,33 +425,37 @@ This indirect referencing is only supported for nested inner hits. [[parent-child-inner-hits]] ==== Parent/child inner hits -The parent/child `inner_hits` can be used to include parent or child +The parent/child `inner_hits` can be used to include parent or child: [source,js] -------------------------------------------------- PUT test { - "settings": { - "mapping.single_type": false - }, "mappings": { - "my_parent": {}, - "my_child": { - "_parent": { - "type": "my_parent" + "doc": { + "properties": { + "my_join_field": { + "type": "join", + "my_parent": "my_child" + } } } } } -PUT test/my_parent/1?refresh +PUT test/doc/1?refresh { - "test": "test" + "number": 1, + "my_join_field": "my_parent" } -PUT test/my_child/1?parent=1&refresh +PUT test/doc/2?routing=1&refresh { - "test": "test" + "number": 1, + "my_join_field": { + "name": "my_child", + "parent": "1" + } } POST test/_search @@ -461,7 +465,7 @@ POST test/_search "type": "my_child", "query": { "match": { - "test": "test" + "number": 1 } }, "inner_hits": {} <1> @@ -478,41 +482,61 @@ An example of a response snippet that could be generated from the above search r [source,js] -------------------------------------------------- { - ..., - "hits": { - "total": 1, - "max_score": 1.0, - "hits": [ - { - "_index": "test", - "_type": "my_parent", - "_id": "1", - "_score": 1.0, - "_source": ..., - "inner_hits": { - "my_child": { - "hits": { - "total": 1, - "max_score": 0.18232156, - "hits": [ - { - "_type": "my_child", - "_id": "1", - "_score": 0.18232156, - "_routing": "1", - "_parent": "1", - "_source": { - "test": "test" - } + ..., + "hits": { + "total": 1, + "max_score": 1.0, + "hits": [ + { + "_index": "test", + "_type": "doc", + "_id": "1", + "_score": 1.0, + "_source": { + "number": 1, + "my_join_field": "my_parent" + }, + "fields": { + "my_join_field": [ + "my_parent" + ] + }, + "inner_hits": { + "my_child": { + "hits": { + "total": 1, + "max_score": 1.0, + "hits": [ + { + "_type": "doc", + "_id": "2", + "_score": 1.0, + "_routing": "1", + "_source": { + "number": 1, + "my_join_field": { + "name": "my_child", + "parent": "1" + } + }, + "fields": { + "my_join_field": [ + "my_child" + ], + "my_join_field#my_parent": [ + "1" + ] + } + } + ] + } + } } - ] } - } - } - } - ] - } + ] + } } -------------------------------------------------- // TESTRESPONSE[s/"_source": \.\.\./"_source": $body.hits.hits.0._source/] +// TESTRESPONSE[s/"fields": \.\.\./"fields": $body.hits.hits.0.fields/] // TESTRESPONSE[s/\.\.\./"timed_out": false, "took": $body.took, "_shards": $body._shards/] From 2bce2965a0d09464f2c9c674e0b5988578b039f6 Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Wed, 14 Jun 2017 19:39:30 +0200 Subject: [PATCH 2/6] remove replace rule that is not required --- docs/reference/search/request/inner-hits.asciidoc | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/reference/search/request/inner-hits.asciidoc b/docs/reference/search/request/inner-hits.asciidoc index 00edaba79c6c3..350b3616c86df 100644 --- a/docs/reference/search/request/inner-hits.asciidoc +++ b/docs/reference/search/request/inner-hits.asciidoc @@ -538,5 +538,4 @@ An example of a response snippet that could be generated from the above search r } -------------------------------------------------- // TESTRESPONSE[s/"_source": \.\.\./"_source": $body.hits.hits.0._source/] -// TESTRESPONSE[s/"fields": \.\.\./"fields": $body.hits.hits.0.fields/] // TESTRESPONSE[s/\.\.\./"timed_out": false, "took": $body.took, "_shards": $body._shards/] From a088fcf0794eeb0432249472b2221350990e86c0 Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Thu, 15 Jun 2017 01:03:09 +0200 Subject: [PATCH 3/6] explain the single parent/child relation first and moves the multiple levels relations to the end of the docs. Add links in the main types page --- docs/reference/mapping/types.asciidoc | 4 +- .../mapping/types/parent-join.asciidoc | 220 ++++++++++-------- 2 files changed, 131 insertions(+), 93 deletions(-) diff --git a/docs/reference/mapping/types.asciidoc b/docs/reference/mapping/types.asciidoc index 6e671fe704258..7cd2010726e99 100644 --- a/docs/reference/mapping/types.asciidoc +++ b/docs/reference/mapping/types.asciidoc @@ -38,6 +38,8 @@ string:: <> and <> <>:: Accepts queries from the query-dsl +<>:: Defines parent/child relation for documents within the same index + [float] === Multi-fields @@ -84,7 +86,7 @@ include::types/token-count.asciidoc[] include::types/percolator.asciidoc[] - +include::types/parent-join.asciidoc[] diff --git a/docs/reference/mapping/types/parent-join.asciidoc b/docs/reference/mapping/types/parent-join.asciidoc index 3908d9f2b29a2..f19857fb80751 100644 --- a/docs/reference/mapping/types/parent-join.asciidoc +++ b/docs/reference/mapping/types/parent-join.asciidoc @@ -5,7 +5,7 @@ The `join` datatype is a special field that creates 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 single parent/child relation can be defined as follow: +A parent/child relation can be defined as follow: [source,js] -------------------------------------------------- @@ -26,56 +26,11 @@ PUT my_index // CONSOLE <1> The name for the field -<2> `my_parent` is parent of `my_child`. +<2> Defines a single relation where `my_parent` is parent of `my_child`. -It is also possible to define multiple children for a single parent: - -[source,js] --------------------------------------------------- -PUT my_index -{ - "mappings": { - "doc": { - "properties": { - "my_join_field": { - "type": "join", - "my_parent": ["my_child", "another_child"] <1> - } - } - } - } -} --------------------------------------------------- -// CONSOLE - -<1> `my_parent` is parent of `my_child`. - -... and multiple levels of parent/child: - -[source,js] --------------------------------------------------- -PUT my_index -{ - "mappings": { - "doc": { - "properties": { - "my_join_field": { - "type": "join", - "my_parent": ["my_child", "another_child"], <1> - "another_child": "grand_child" <2> - } - } - } - } -} --------------------------------------------------- -// CONSOLE - -<1> `my_parent` is parent of `my_child` and `another_child` -<2> `another_child` is parent of `grand_child - -To index a parent `my_parent` document the name of the relation -must be added to the `_source`: +To index a document with a join, the name of the relation and the optional parent +of the document must be provided in the `source`. +For instance the following creates a parent document in the `my_parent` context: [source,js] -------------------------------------------------- @@ -84,6 +39,12 @@ PUT my_index/doc/1?refresh "text": "This is a parent document", "my_join_field": "my_parent" <1> } + +PUT my_index/doc/2?refresh +{ + "text": "This is a another parent document", + "my_join_field": "my_parent" +} -------------------------------------------------- // CONSOLE // TEST[continued] @@ -92,16 +53,14 @@ PUT my_index/doc/1?refresh When indexing a child, the name of the relation as well as the parent id of the document must be added in the `_source`. - - It is required to index the lineage of a parent in the same shard so you must always route child documents using their greater parent id. -For instance the following index a child document with a `routing` value -equals to the `id` of the parent: +For instance the following index two children documents pointing to the same parent +with a `routing` value equals to the `id` of the parent: [source,js] -------------------------------------------------- -PUT my_index/doc/2?routing=1&refresh <1> +PUT my_index/doc/3?routing=1&refresh <1> { "text": "This is a child document", "my_join_field": { @@ -109,35 +68,24 @@ PUT my_index/doc/2?routing=1&refresh <1> "parent": "1" <3> } } --------------------------------------------------- -// CONSOLE -// TEST[continued] - -<1> This child document must be on the same shard than its parent -<2> This is `my_child` document -<3> The parent id of this child document -Similarly indexing a great child document requires a `routing` value equals -to the grand-parent (the greater parent of the lineage): - -[source,js] --------------------------------------------------- -PUT my_index/doc/3?routing=1&refresh <1> +PUT my_index/doc/4?routing=1&refresh <1> { - "text": "This is a grand child document", + "text": "This is a another child document", "my_join_field": { - "name": "grand_child", - "parent": "2" <2> + "name": "my_child", + "parent": "1" } } -------------------------------------------------- // CONSOLE // TEST[continued] -<1> This child document must be on the same shard than its grandparent and parent -<2> The parent id of this document (must points to an `another_child` document) +<1> This child document must be on the same shard than its parent +<2> `my_child` is the name of the join for this document +<3> The parent id of this child document -==== Parent-child restrictions +==== Parent-join restrictions * Only one `join` field is allowed per index mapping. * An element can have multiple children but only one parent. @@ -181,7 +129,7 @@ GET my_index/_search { ..., "hits": { - "total": 3, + "total": 4, "max_score": null, "hits": [ { @@ -195,7 +143,7 @@ GET my_index/_search }, "fields": { "my_join_field": [ - "my_parent" <1> + "my_parent" ] }, "sort": [ @@ -207,6 +155,24 @@ GET my_index/_search "_type": "doc", "_id": "2", "_score": null, + "_source": { + "text": "This is a another parent document", + "my_join_field": "my_parent" + }, + "fields": { + "my_join_field": [ + "my_parent" + ] + }, + "sort": [ + "2" + ] + }, + { + "_index": "my_index", + "_type": "doc", + "_id": "3", + "_score": null, "_routing": "1", "_source": { "text": "This is a child document", @@ -217,39 +183,39 @@ GET my_index/_search }, "fields": { "my_join_field": [ - "my_child" <2> + "my_child" ], "my_join_field#my_parent": [ - "1" <3> + "1" ] }, "sort": [ - "2" + "3" ] }, { "_index": "my_index", "_type": "doc", - "_id": "3", + "_id": "4", "_score": null, "_routing": "1", "_source": { - "text": "This is a grand child document", + "text": "This is a another child document", "my_join_field": { - "name": "grand_child", - "parent": "2" + "name": "my_child", + "parent": "1" } }, "fields": { "my_join_field": [ - "grand_child" <4> + "my_child" ], - "my_join_field#another_child": [ - "2" <5> + "my_join_field#my_parent": [ + "1" ] }, "sort": [ - "3" + "4" ] } ] @@ -258,11 +224,10 @@ GET my_index/_search -------------------------------------------------- // TESTRESPONSE[s/\.\.\./"timed_out": false, "took": $body.took, "_shards": $body._shards/] -<1> This is a parent document in the `my_parent` context -<2> This is child document in the `my_child` context -<3> The linked parent id for the child document -<4> This is child document in the `grand_child` context -<5> The linked parent id for the child document +<1> This document belongs to the `my_parent` join +<2> This document belongs to the `my_parent` join +<3> This document belongs to the `my_child` join +<4> The linked parent id for the child document ==== Parent-join queries and aggregations @@ -361,3 +326,74 @@ GET _nodes/stats/indices/fielddata?human&fields=my_join_field#my_parent -------------------------------------------------- // CONSOLE // TEST[continued] + +==== Multiple levels of parent join + +It is also possible to define multiple children for a single parent: + +[source,js] +-------------------------------------------------- +PUT my_index +{ + "mappings": { + "doc": { + "properties": { + "my_join_field": { + "type": "join", + "my_parent": ["my_child", "another_child"] <1> + } + } + } + } +} +-------------------------------------------------- +// CONSOLE + +<1> `my_parent` is parent of `my_child`. + +... and multiple levels of parent/child: + +[source,js] +-------------------------------------------------- +PUT my_index +{ + "mappings": { + "doc": { + "properties": { + "my_join_field": { + "type": "join", + "my_parent": ["my_child", "another_child"], <1> + "another_child": "grand_child" <2> + } + } + } + } +} +-------------------------------------------------- +// CONSOLE + +<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 +to the grand-parent (the greater parent of the lineage): + + +[source,js] +-------------------------------------------------- +PUT my_index/doc/3?routing=1&refresh <1> +{ + "text": "This is a grand child document", + "my_join_field": { + "name": "grand_child", + "parent": "2" <2> + } +} +-------------------------------------------------- +// CONSOLE +// TEST[continued] + +<1> This child document must be on the same shard than its grandparent and parent +<2> The parent id of this document (must points to an `another_child` document) + + From 44de7acec5789b0ce9ced16121a5fbd82735f091 Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Thu, 15 Jun 2017 11:08:46 +0200 Subject: [PATCH 4/6] Address review comments --- docs/reference/mapping/types/parent-join.asciidoc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/reference/mapping/types/parent-join.asciidoc b/docs/reference/mapping/types/parent-join.asciidoc index f19857fb80751..a5dcc70a3fe11 100644 --- a/docs/reference/mapping/types/parent-join.asciidoc +++ b/docs/reference/mapping/types/parent-join.asciidoc @@ -5,7 +5,7 @@ The `join` datatype is a special field that creates 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: +A parent/child relation can be defined as follows: [source,js] -------------------------------------------------- @@ -375,7 +375,17 @@ PUT my_index <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 +The mapping above represents the following tree: + + my_parent + / \ + / \ + my_child another_child + | + | + grand_child + +Indexing a grand child document requires a `routing` value equals to the grand-parent (the greater parent of the lineage): From fa1cea9ab04e061c66469acdc0a5a5ab49a51ff4 Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Thu, 15 Jun 2017 11:13:07 +0200 Subject: [PATCH 5/6] fix typo --- docs/reference/mapping/types/parent-join.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/mapping/types/parent-join.asciidoc b/docs/reference/mapping/types/parent-join.asciidoc index a5dcc70a3fe11..d13d6accb9087 100644 --- a/docs/reference/mapping/types/parent-join.asciidoc +++ b/docs/reference/mapping/types/parent-join.asciidoc @@ -373,7 +373,7 @@ PUT my_index // CONSOLE <1> `my_parent` is parent of `my_child` and `another_child` -<2> `another_child` is parent of `grand_child +<2> `another_child` is parent of `grand_child` The mapping above represents the following tree: From a5634f258f4678d5b65628b355d925c428138075 Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Fri, 16 Jun 2017 09:16:48 +0200 Subject: [PATCH 6/6] add missing bullets --- docs/reference/mapping/types/parent-join.asciidoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/reference/mapping/types/parent-join.asciidoc b/docs/reference/mapping/types/parent-join.asciidoc index 87a56b119d94b..68e9b84158ccb 100644 --- a/docs/reference/mapping/types/parent-join.asciidoc +++ b/docs/reference/mapping/types/parent-join.asciidoc @@ -145,7 +145,7 @@ GET my_index/_search }, "fields": { "my_join_field": [ - "my_parent" + "my_parent" <1> ] }, "sort": [ @@ -163,7 +163,7 @@ GET my_index/_search }, "fields": { "my_join_field": [ - "my_parent" + "my_parent" <2> ] }, "sort": [ @@ -179,8 +179,8 @@ GET my_index/_search "_source": { "text": "This is a child document", "my_join_field": { - "name": "my_child", - "parent": "1" + "name": "my_child", <3> + "parent": "1" <4> } }, "fields": {