public IndexDeleteByQueryResponse getIndex(String index) {
return indices.get(index);
}
public RestStatus status() {
RestStatus status = RestStatus.OK;
for (IndexDeleteByQueryResponse indexResponse : indices.values()) {
if (indexResponse.getFailedShards() > 0) {
RestStatus indexStatus = indexResponse.getFailures()[0].status();
if (indexResponse.getFailures().length > 1) {
for (int i = 1; i < indexResponse.getFailures().length; i++) {
if (indexResponse.getFailures()[i].status().getStatus() >= 500) {
indexStatus = indexResponse.getFailures()[i].status();
}
}
}
if (status.getStatus() < indexStatus.getStatus()) {
status = indexStatus;
}
}
}
return status;