Skip to content

Commit

Permalink
Fix example syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
leemthompo committed Aug 1, 2024
1 parent 373e94f commit b639a8c
Showing 1 changed file with 29 additions and 12 deletions.
41 changes: 29 additions & 12 deletions docs/reference/mapping/params/copy-to.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -69,30 +69,47 @@ The following configuration will not copy data from `field_1` to `field_3`:
+
[source,console]
----
PUT /bad_example_index
{
"field_1": {
"type": "text",
"copy_to": "field_2"
},
"field_2": {
"type": "text",
"copy_to": "field_3"
"mappings": {
"properties": {
"field_1": {
"type": "text",
"copy_to": "field_2"
},
"field_2": {
"type": "text",
"copy_to": "field_3"
},
"field_3": {
"type": "text"
}
}
}
}
----
// TEST[skip:]
Instead, copy to multiple fields from the source field:
+
[source,console]
----
PUT /good_example_index
{
"field_1": {
"type": "text",
"copy_to": [ "field_2", "field_3" ]
"mappings": {
"properties": {
"field_1": {
"type": "text",
"copy_to": ["field_2", "field_3"]
},
"field_2": {
"type": "text"
},
"field_3": {
"type": "text"
}
}
}
}
----
// TEST[skip:]

NOTE: `copy_to` is not supported for field types where values take the form of objects, e.g. `date_range`.

Expand Down

0 comments on commit b639a8c

Please sign in to comment.