Skip to content

Commit

Permalink
[Bulk] Add _index, _id, status to ERROR object
Browse files Browse the repository at this point in the history
Signed-off-by: Aswath <[email protected]>
This is to reduce the bulk response size  with filter_path on items.index.error and capture failed documents
  • Loading branch information
aswath86 committed Sep 13, 2023
1 parent b90a888 commit 3c46ea4
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
builder.field(_ID, failure.getId());
builder.field(STATUS, failure.getStatus().getStatus());
builder.startObject(ERROR);
builder.field(_INDEX, failure.getIndex());
builder.field(_ID, failure.getId());
builder.field(STATUS, failure.getStatus().getStatus());
OpenSearchException.generateThrowableXContent(builder, params, failure.getCause());
builder.endObject();
}
Expand Down

0 comments on commit 3c46ea4

Please sign in to comment.