-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[Bulk] Add _index, _id, status to ERROR object #10015
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
base: main
Are you sure you want to change the base?
Changes from all commits
3c46ea4
cbc0a90
693cea5
140d25d
620165f
0a71128
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,6 +96,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()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding these new fields will add to the b/w usage for existing users who are not using filter path. I would suggest that we rather include this in the error reason in a way that this is backward compatible. You can also consider adding a new field that can be controlled by query parameter similar to what we have in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By default we should not be increasing the response size and it should be controlled by the user that they need the additional information that you have added here. |
||
builder.field(_ID, failure.getId()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this always generated when the error is passed? What if the error was encountered even before the document id could be generated? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then the behaviour would be the same as in for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In that case, I see that users who are not providing filter_path, they will get the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, if filter_path only contains error, how are users able to determine which document actually failed since successful docs won't return any response, and with auto-generated id, it becomes difficult for clients to know which document failed. (Applicable only for auto generated ids) |
||
builder.field(STATUS, failure.getStatus().getStatus()); | ||
OpenSearchException.generateThrowableXContent(builder, params, failure.getCause()); | ||
builder.endObject(); | ||
} | ||
|
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.
Can you add tests for this?