Say your mappings look like this:
{
"properties": {
"foo": {
"type": "nested",
"include_in_root": true,
"include_in_parent": true
}
}
}
Then we make sure to only copy to the root if it is different from the parent document. However if you start having more than one level of nesting:
{
"properties": {
"foo": {
"type": "nested",
"include_in_root": true,
"include_in_parent": true,
"properties": {
"bar": {
"type": "nested",
"include_in_root": true,
"include_in_parent": true
}
}
}
}
}
Then foo.bar will copy fields to both the root and parent since parent != root. And then foo will copy fields to its parent, which is the root as well. So fields of foo.bar will end up twice in the root document.