BulkItemResponse returns status code instead of status name

In commit fafeb3a, we've refactored REST response handling logic
and returned HTTP status names instead of HTTP status codes for
bulk item responses. With this commit we restore the original
behavior.

Checked with @bleskes.
This commit is contained in:
Daniel Mitterdorfer 2015-12-11 16:22:36 +01:00
parent 90ff1ad5fb
commit f5d307e426
1 changed files with 2 additions and 2 deletions

View File

@ -51,12 +51,12 @@ public class BulkItemResponse implements Streamable, StatusToXContent {
builder.startObject(opType);
if (failure == null) {
response.toXContent(builder, params);
builder.field(Fields.STATUS, response.status());
builder.field(Fields.STATUS, response.status().getStatus());
} else {
builder.field(Fields._INDEX, failure.getIndex());
builder.field(Fields._TYPE, failure.getType());
builder.field(Fields._ID, failure.getId());
builder.field(Fields.STATUS, failure.getStatus());
builder.field(Fields.STATUS, failure.getStatus().getStatus());
builder.startObject(Fields.ERROR);
ElasticsearchException.toXContent(builder, params, failure.getCause());
builder.endObject();