// Work out if the indices is a list of features
if (features == null && indices.length > 0 && indices[0] != null && indices[0].startsWith("_") && !"_all".equals(indices[0])) {
features = indices;
indices = new String[] {"_all"};
}
final GetIndexRequest getIndexRequest = new GetIndexRequest();
getIndexRequest.indices(indices);
if (features != null) {
getIndexRequest.features(features);
}
getIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, getIndexRequest.indicesOptions()));
getIndexRequest.local(request.paramAsBoolean("local", getIndexRequest.local()));
client.admin().indices().getIndex(getIndexRequest, new RestBuilderListener<GetIndexResponse>(channel) {
@Override
public RestResponse buildResponse(GetIndexResponse response, XContentBuilder builder) throws Exception {
String[] features = getIndexRequest.features();
String[] indices = response.indices();
builder.startObject();
for (String index : indices) {
builder.startObject(index);