Client client=new ESClient().getClient();
Map<String,IndexMetaData> indexState=client.admin().cluster().prepareState().execute().actionGet()
.getState().getMetaData().indices();
List<String> closeIdx=new ArrayList<String>();
for(String idx : indexState.keySet()) {
IndexMetaData idxM=indexState.get(idx);
if(idxM.getState().equals(State.CLOSE))
closeIdx.add(idx);
}
return closeIdx;
}