-
Notifications
You must be signed in to change notification settings - Fork 727
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
Allow document to be overwritten in onDocument
iteratee of bulk helper
#1732
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
@delvedor Is this PR something we could merge? Anything I can do to speed up/help with the process? |
Thanks for this fix @robdasilva. @delvedor is no longer the maintainer of this library, and I am taking over. I'll try to take a look soon to make sure this looks good. |
Thanks for the heads-up, @JoshMock. Let me know, if anything. |
jenkins test this |
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.
I like this approach, even more than the two proposals in #1209, because it is a non-breaking change to the onDocument
return type! Everyone wins.
I did some local tests with it and it seems to work as advertised, so I'll merge shortly, add some docs to reflect the improvement, and try to get it out in 8.8.2 and 8.9.0.
type UpdateAction = [UpdateActionOperation, Record<string, any>] | ||
type CreateAction = CreateActionOperation | [CreateActionOperation, unknown] | ||
type IndexAction = IndexActionOperation | [IndexActionOperation, unknown] | ||
type UpdateAction = [UpdateActionOperation, T.BulkUpdateAction] |
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.
Nice catch, not sure why this was Record
before. 🤔
Adds a section detailing how to modify documents before sending to the bulk API, using the improvement introduced in #1732
…per (#1732) Co-authored-by: Josh Mock <[email protected]>
…per (#1732) Co-authored-by: Josh Mock <[email protected]>
…tee of bulk helper (#1732)Co-authored-by: Josh Mock <[email protected]> (#1952) Co-authored-by: Robert Da Silva <[email protected]>
…tee of bulk helper (#1732)Co-authored-by: Josh Mock <[email protected]> (#1953) Co-authored-by: Robert Da Silva <[email protected]>
Allows the document to be submitted to be altered in the
onDocument
iteratee of thebulk
method of the Elasticsearch Client Helpers.Fixes #1209