-
Notifications
You must be signed in to change notification settings - Fork 187
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]: a bulk request with Update operation for existing document results in 400 Bad request #590
Comments
Looks like a legit bug. Want to try to turn it into a (failing) unit test? |
@dblock , thanks for your response. I will write a unit test for it. |
Maybe this is only reproducible when using the RestClientTransport. I couldn't reproduce the error using ApacheHttpClient5Transport client.
The commented out code is another way to do the bulk update for both documents at once.
|
@IgorDomshchikov I couldn't get my code to create a rest client with the 2.9.0 version of the library. However, I was able to validate that the bulk update works as expected with the 3.0.0-SNAPSHOT version. Most of the code I added above remains the same for this test, except the following -
I also threw in a wait after the update operations since in some instances the code would run the select before the updates reflected in the index.
|
@IgorDomshchikov I was able to setup a test using the versions you mentioned with the only difference being my opensearch was running on my local on docker. I'm unable to reproduce the error with either transport protocol. |
@IgorDomshchikov A similar example was added by @karthiks3000 in #690 to the samples folder which works successfully. Can you please let us know if this is the same use-case you have or if there is anything different about your use-case and you are still facing issues? Thank you! |
Updating an existing document using a Bulk API with
update
operation type results in 400 Bad request.Steps to reproduce the issue:
BulkRequest
obj. Thedoc
is a POJO obj that reflects the document in the Index.The received result is 400 Bad Request
Expected result: the document should be successfully updated if it exists in the index.
In the debug mode, the parsed bulk request looks different than it should per the bulk update documentation. It lacks the "doc" parent object, which should wrap the partially updated document:
The issue is reproducible using the latest available OpenSearch Java client version
The OpenSearch is provisioned by AWS.
If I replace a bulk update request with a single document update request, I get successful results. The parsed request structure matches the documentation one:
{"doc":{"status":"active"}}
The text was updated successfully, but these errors were encountered: