Tweak copy_to handling in synthetic _source to account for nested objects#120974
Tweak copy_to handling in synthetic _source to account for nested objects#120974lkts merged 6 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
|
Hi @lkts, I've created a changelog YAML for you. |
| continue; | ||
| } | ||
| int offset = parent.isRoot() ? 0 : parent.fullPath().length() + 1; | ||
| mutableList.add(new IgnoredSourceFieldMapper.NameValue(copyToField, offset, XContentDataHelper.voidValue(), context.doc())); |
There was a problem hiding this comment.
The problem is this call to context.doc(). This is a root document and not a correct nested document.
| int offset = parent.isRoot() ? 0 : parent.fullPath().length() + 1; | ||
| ignoredFieldValues.add(new IgnoredSourceFieldMapper.NameValue(copyToField, offset, XContentDataHelper.voidValue(), doc)); | ||
| } | ||
| } |
There was a problem hiding this comment.
I think getCopyToFields is not called any more? If so, remove it - and maybe inline markFieldAsCopyTo here and remove it.
There was a problem hiding this comment.
Not related to this change, but also cloneWithRecordedSource(...) is not used.
There was a problem hiding this comment.
markFieldAsCopyTo is done after parsing and this is done before and i don't know if this is important. I won't experiment.
| int offset = parent.isRoot() ? 0 : parent.fullPath().length() + 1; | ||
| ignoredFieldValues.add(new IgnoredSourceFieldMapper.NameValue(copyToField, offset, XContentDataHelper.voidValue(), doc)); | ||
| } | ||
| } |
There was a problem hiding this comment.
Not related to this change, but also cloneWithRecordedSource(...) is not used.
💚 Backport successful
|
Closes #120831.