protected ShardStats shardOperation(IndexShardStatsRequest request) throws ElasticsearchException {
InternalIndexService indexService = (InternalIndexService) indicesService.indexServiceSafe(request.shardId().getIndex());
InternalIndexShard indexShard = (InternalIndexShard) indexService.shardSafe(request.shardId().id());
// if we don't have the routing entry yet, we need it stats wise, we treat it as if the shard is not ready yet
if (indexShard.routingEntry() == null) {
throw new IndexShardMissingException(indexShard.shardId());
}
CommonStatsFlags flags = new CommonStatsFlags().clear();
if (request.request.docs()) {