Returning ignored fields in the simulate ingest API#117214
Merged
masseyke merged 22 commits intoelastic:mainfrom Dec 23, 2024
Merged
Returning ignored fields in the simulate ingest API#117214masseyke merged 22 commits intoelastic:mainfrom
masseyke merged 22 commits intoelastic:mainfrom
Conversation
Collaborator
|
Hi @masseyke, I've created a changelog YAML for you. |
Collaborator
|
Pinging @elastic/es-data-management (Team:Data Management) |
dakrone
approved these changes
Dec 23, 2024
| * This creates a temporary index with the mappings of the index in the request, and then attempts to index the source from the request | ||
| * into it. If there is a mapping exception, that exception is returned. On success the returned exception is null. | ||
| * @parem componentTemplateSubstitutions The component template definitions to use in place of existing ones for validation | ||
| * @param componentTemplateSubstitutions The component template definitions to use in place of existing ones for validation |
| }); | ||
| final Collection<String> ignoredFields; | ||
| if (result == null) { | ||
| ignoredFields = List.of(); |
Member
There was a problem hiding this comment.
We could probably just do return List.of(); here and avoid having to create the ignoredFields local field? It's not a big deal either way though.
Member
Author
There was a problem hiding this comment.
I kind of prefer having a single return statement rather than 3 -- it makes debugging easier for me.
| ignoredFields = List.of(); | ||
| } else { | ||
| List<LuceneDocument> luceneDocuments = result.parsedDoc().docs(); | ||
| if (luceneDocuments != null && luceneDocuments.size() == 1) { |
Member
There was a problem hiding this comment.
Should we add an assert luceneDocuments().size() == 1 somewhere here to ensure that we fail if in the future a single index request results in more than one doc? (We'd silently ignored the response if we didn't)
Collaborator
💚 Backport successful
|
masseyke
added a commit
that referenced
this pull request
Dec 24, 2024
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.
As described in #116497, A new
ignored_fieldsarray is returned if ingest would ignore any fields in the input. For example: