Using copy_to in the dynamic templates for nested documents

Hi Team,

I saw the thread https://github.com/elastic/elasticsearch/issues/12461 where there is a plan to deprecate include_in_parent. The suggestion is to us copy_to

Our requirement is to search for values with the field name. So there is a requirement to have a unique field name and we have seen dynamic template where we can add "copy_to": {name}.

The problem is that in our nested structure we have a similar field name at multiple levels and the copy_to copies everything to a single common field.

Kindly suggest how to use the full nested path for copy_to.. Something like this

{
"mappings" : {
"dynamic_templates": [
{
"field_name": {
"match": "*",
"mapping": {
"copy_to": "{parent}.{name}"
}
}
}
]
}
}'

Also let us know if include_in_parent is planned to be deprecated anytime soon?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.