elastic / elastic/elasticsearch
Add Warning Http Header when one ore more documents fails in bulk
- Dominant language
- Java
- Stars
- 77.9k
- Forks
- 26.1k
- PR merge metrics
- PR metrics pending
Description
Have this `BytesResponse` from a bulk-operation, where `Success = true`:
```json
Successful (200) low level call on POST: /_bulk
{
"took":0,
"errors":true,
"items":[{"index":{"_index":"logstash-2021.07.12","_type":"_doc","_id":"OTgmmnoBq3Eup03vE24t","status":403,"error":{"type":"security_exception","reason":"action [indices:data/write/bulk[s]] is unauthorized for API key id [NzgjmnoBq3Eup03vg25H] of user [elastic] on indices [logstash-2021.07.12], this action is granted by the index privileges [create_doc,create,delete,index,write,all]"}
```
And when checking Http-Headers then there is no "Warning" header:
```c#
responseMessage.Headers.TryGetValues("Warning", out warnings);
```
Please add "Warning"-header to also signal that "One ore more items with errors", when no other "deprecated warnings". Then one can react on this and deserialize the entire response to diagnose the issue (Avoid spending time on deserializing succesful responses, when no warnings).
See also: https://github.com/elastic/elastic-transport-net/issues/30
Contributor guide
Assessment
This issue has not been assessed yet.