IndexHealth newIndexHealth = new IndexHealth();
newIndexHealth.name = index.getIndexName() + "/" + index.getIndexType();
newIndexHealth.documentCount = indexStat.getDocumentCount();
newIndexHealth.lastSync = indexStat.getLastUpdate();
IndicesStatsRequestBuilder statRequest = searchClient.prepareStats(index.getIndexName())
.setTypes(index.getIndexType());
IndicesStatsResponse indicesStatsResponse = statRequest.get();
newIndexHealth.segmentCount = indicesStatsResponse.getTotal().getSegments().getCount();
newIndexHealth.pendingDeletion = indicesStatsResponse.getTotal().getDocs().getDeleted();
builder.put(newIndexHealth.name, newIndexHealth);
}