use of org.xbib.elasticsearch.skywalker.reconstruct.DocumentReconstructor in project elasticsearch-skywalker by jprante.
the class TransportReconstructAction method shardOperation.
@Override
protected ShardReconstructIndexResponse shardOperation(ShardReconstructIndexRequest request) throws ElasticsearchException {
IndexService indexService = indicesService.indexService(request.index());
InternalIndexShard indexShard = (InternalIndexShard) indexService.shardSafe(request.shardId());
Engine.Searcher searcher = indexShard.engine().acquireSearcher("transport_reconstruct");
IndexReader reader = searcher.reader();
DocumentReconstructor dr = new DocumentReconstructor(reader);
try {
return new ShardReconstructIndexResponse(true, dr.reconstruct(request.shardId()));
} catch (IOException e) {
throw new ElasticsearchException("failed to reconstruct index", e);
}
}
Aggregations