-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EEM] Include identity fields and values in document root #187884
[EEM] Include identity fields and values in document root #187884
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
@@ -144,6 +170,24 @@ export function generateHistoryProcessors(definition: EntityDefinition) { | |||
ignore_missing: true, | |||
}, | |||
}, | |||
{ script: { source: createIdentityFieldsPainlessScript(definition) } }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it necessary to have this complex logic vs something more simple like
...definition.identityFields.map((key) => {
return {
set: {
field: key.field,
value: `{{entity.identityFields.${key.field}}}`,
if: `ctx.entity?.identityFields?.${key.field.replaceAll('.', '?.')} != null`,
}
}
}),
does this correctly handle the nested object behaviour?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did this get tested? i think it should work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it works! Put it back into the original PR!
Merged this work back into #187699 since it made it easier after all. |
Goal of this PR:
For a definition that sets
host.name
as an identity field, the history document produced should havehost.name
set at the root of the document to the value found.For the latest documents, we should collect all the found values for
host.name
and set it to the root as well.Maybe remove displayName from the historical documents.
Undecided how we handle the case where multiple values are found in the latest ingest pipeline.
See #187699 (comment) and #187699 (comment)