Correctly apply field path to JSON processor when adding contents to document root#135479
Merged
jbaiera merged 6 commits intoelastic:mainfrom Sep 25, 2025
Merged
Correctly apply field path to JSON processor when adding contents to document root#135479jbaiera merged 6 commits intoelastic:mainfrom
jbaiera merged 6 commits intoelastic:mainfrom
Conversation
Collaborator
|
Pinging @elastic/es-data-management (Team:Data Management) |
Collaborator
|
Hi @jbaiera, I've created a changelog YAML for you. |
joegallo
reviewed
Sep 25, 2025
modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/JsonProcessor.java
Outdated
Show resolved
Hide resolved
seanzatzdev
approved these changes
Sep 25, 2025
Contributor
There was a problem hiding this comment.
Looks good to me, I agree with @joegallo 's comment
This reverts commit 990e24c.
This was referenced Sep 25, 2025
Collaborator
jbaiera
added a commit
to jbaiera/elasticsearch
that referenced
this pull request
Sep 25, 2025
…document root (elastic#135479) Processor now correctly uses ingest document methods to obtain field data. --------- Co-authored-by: Joe Gallo <joegallo@gmail.com>
jbaiera
added a commit
to jbaiera/elasticsearch
that referenced
this pull request
Sep 25, 2025
…document root (elastic#135479) Processor now correctly uses ingest document methods to obtain field data. --------- Co-authored-by: Joe Gallo <joegallo@gmail.com>
jbaiera
added a commit
to jbaiera/elasticsearch
that referenced
this pull request
Sep 25, 2025
…document root (elastic#135479) Processor now correctly uses ingest document methods to obtain field data. --------- Co-authored-by: Joe Gallo <joegallo@gmail.com>
jbaiera
added a commit
to jbaiera/elasticsearch
that referenced
this pull request
Sep 25, 2025
…document root (elastic#135479) Processor now correctly uses ingest document methods to obtain field data. --------- Co-authored-by: Joe Gallo <joegallo@gmail.com>
elasticsearchmachine
pushed a commit
that referenced
this pull request
Sep 26, 2025
…ts to document root (#135479) (#135498) * Correctly apply field path to JSON processor when adding contents to document root (#135479) Processor now correctly uses ingest document methods to obtain field data. --------- Co-authored-by: Joe Gallo <joegallo@gmail.com> * Remove missing test util --------- Co-authored-by: Joe Gallo <joegallo@gmail.com>
elasticsearchmachine
pushed a commit
that referenced
this pull request
Sep 26, 2025
…nts to document root (#135479) (#135495) * Correctly apply field path to JSON processor when adding contents to document root (#135479) Processor now correctly uses ingest document methods to obtain field data. --------- Co-authored-by: Joe Gallo <joegallo@gmail.com> * Remove missing test util --------- Co-authored-by: Joe Gallo <joegallo@gmail.com>
elasticsearchmachine
pushed a commit
that referenced
this pull request
Sep 26, 2025
…nts to document root (#135479) (#135497) * Correctly apply field path to JSON processor when adding contents to document root (#135479) Processor now correctly uses ingest document methods to obtain field data. --------- Co-authored-by: Joe Gallo <joegallo@gmail.com> * Remove missing test util --------- Co-authored-by: Joe Gallo <joegallo@gmail.com>
elasticsearchmachine
pushed a commit
that referenced
this pull request
Sep 26, 2025
…ts to document root (#135479) (#135496) * Correctly apply field path to JSON processor when adding contents to document root (#135479) Processor now correctly uses ingest document methods to obtain field data. --------- Co-authored-by: Joe Gallo <joegallo@gmail.com> * Remove missing test util --------- Co-authored-by: Joe Gallo <joegallo@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The JSON processor has an option that merges the contents of a parsed json string to the root of the document. When operating in this way, the logic was simply gathering the json string directly from the root of the document. This means that nested fields would not be readable. This is likely because in painless, the exact same functionality is exposed as a built in processor function. In painless, field traversal can be done outside of the processor logic. When calling the method, it will add the contents to whichever map is provided. This is working as expected and should not change. When running in the ingest node, the processor handles all field lookups from the document. This is where the fix was applied.
Fixes: #135170
Since this is a long standing bug, I will try and get a backport to the 8.19 branch as well.