add clean index to indices

This commit is contained in:
kimchy 2010-05-19 22:00:27 +03:00
parent d1acef1e09
commit 5718e27fcf
2 changed files with 10 additions and 1 deletions

View File

@ -60,4 +60,9 @@ public interface IndicesService extends Iterable<IndexService>, LifecycleCompone
IndexService createIndex(String index, Settings settings, String localNodeId) throws ElasticSearchException;
void deleteIndex(String index) throws ElasticSearchException;
/**
* Cleans the index without actually deleting any content for it.
*/
void cleanIndex(String index) throws ElasticSearchException;
}

View File

@ -201,7 +201,11 @@ public class InternalIndicesService extends AbstractLifecycleComponent<IndicesSe
return indexService;
}
public synchronized void deleteIndex(String index) throws ElasticSearchException {
@Override public synchronized void cleanIndex(String index) throws ElasticSearchException {
deleteIndex(index, false);
}
@Override public synchronized void deleteIndex(String index) throws ElasticSearchException {
deleteIndex(index, true);
}