From 0f4a3ca54a6301f78ca58b26ca393ab96cc7e3d6 Mon Sep 17 00:00:00 2001 From: dancer13 Date: Sat, 1 Nov 2025 12:44:06 +0100 Subject: [PATCH 1/2] docs: fix mappings field type join example Example goal is to index documents on different parents, but ONLY 1 is specified Signed-off-by: dancer13 --- _mappings/supported-field-types/join.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_mappings/supported-field-types/join.md b/_mappings/supported-field-types/join.md index 32debd24f4d..9b99d067361 100644 --- a/_mappings/supported-field-types/join.md +++ b/_mappings/supported-field-types/join.md @@ -84,7 +84,7 @@ PUT testindex1/_doc/4?routing=1 "name": "Product 2", "product_to_brand": { "name": "product", - "parent": "1" + "parent": "2" } } ``` @@ -332,4 +332,4 @@ PUT testindex1 ## Next steps - Learn about [joining queries]({{site.url}}{{site.baseurl}}/query-dsl/joining/) on join fields. -- Learn more about [retrieving inner hits]({{site.url}}{{site.baseurl}}/search-plugins/searching-data/inner-hits/). \ No newline at end of file +- Learn more about [retrieving inner hits]({{site.url}}{{site.baseurl}}/search-plugins/searching-data/inner-hits/). From 6aac4d79ad2d2751fb191a9d4142d2288a8131a7 Mon Sep 17 00:00:00 2001 From: dancer13 Date: Wed, 12 Nov 2025 11:25:18 +0100 Subject: [PATCH 2/2] refactor: address review comments Signed-off-by: dancer13 --- _mappings/supported-field-types/join.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_mappings/supported-field-types/join.md b/_mappings/supported-field-types/join.md index 9b99d067361..04b71c7f8c3 100644 --- a/_mappings/supported-field-types/join.md +++ b/_mappings/supported-field-types/join.md @@ -64,7 +64,7 @@ PUT testindex1/_doc/1 When indexing child documents, you need to specify the `routing` query parameter because parent and child documents in the same parent/child hierarchy must be indexed on the same shard. For more information, see [Routing]({{site.url}}{{site.baseurl}}/mappings/metadata-fields/routing/). Each child document refers to its parent's ID in the `parent` field. -Index two child documents, one for each parent: +Index two child documents for the same parent: ```json PUT testindex1/_doc/3?routing=1 @@ -84,7 +84,7 @@ PUT testindex1/_doc/4?routing=1 "name": "Product 2", "product_to_brand": { "name": "product", - "parent": "2" + "parent": "1" } } ```