Fix parsing of flattened fields within subobjects: false#105373
Fix parsing of flattened fields within subobjects: false#105373felixbarny merged 3 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/es-search (Team:Search) |
|
Hi @felixbarny, I've created a changelog YAML for you. |
javanna
left a comment
There was a problem hiding this comment.
LGTM, I'm afraid that flattened isn't the only exception, there's also rank features and percolator that are hit by the same bug perhaps. Thanks for finding and fixing. Does this fix a related issue? I did not see its link in the description.
💚 Backport successful
|
I don't think there's an issue that has been filed for this. I've detected the issue myself when playing around with |
DocumentParser#doParseObjectwrongly assumes that after parsing an object, we're not in a leaf object context anymore. While it is usually the case that there are no sub-objects within an object that's mapped assubobjects: false, there's one exception to the rule: when a field is mapped asflattened. While theDocumentParserdoes successfully parse objects that are mapped as flattened within asubobjects: falsecontext, it setscontext.path().setWithinLeafObject(false)after parsing a flattened object so that subsequent fields get their dots expanded.