-
Notifications
You must be signed in to change notification settings - Fork 123
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
[BUG] bulk ignoring more than one operation #593
Comments
Looks legit. Want to try to write a unit test that reproduces this? Maybe a fix? :) |
Sure, I can do this in spare time. For my personal patch fix I've just added iteration over all { action, payload } pairs and it does the job. I just need to cover edge cases, for example: what if user uses odd number of elements in the array. |
Is this issue something we are still looking to fix? I can work on creating the unit test for this. |
Hi @AbhinavGarg90! Sure, unit tests would be super helpful! Here's the patch I mentioned before.
|
Thanks, I'll look into this and make the PR. |
What is the bug?
Firstly thanks for maintaining the library folks!
The bug I found is related to the bulk call that performs multiple operations, possibly on different indices.
How can one reproduce the bug?
Implement your
onDocument
callback to return more than one operation. Below example with upserting data to two different indices.What is the expected behavior?
Expected behaviour is that both
index_a
andindex_b
are updated, however the library is making bulk requests to only the first index.The OpenSearch API allows you to specify different operations to different indices. I've tested this manually through curl to confirm and can attach example request if needed.
What is your host/environment?
OS: Ubuntu 22.04 x86_64
node: v18.13.0
opensearch-js: 2.3.1
Do you have any screenshots?
n/a
Do you have any additional context?
The bug is caused by assumption that you will perform just one operation, see this line.
Please take a look and let me know what do you think.
The text was updated successfully, but these errors were encountered: