private void delete(final IndexShard indexShard) {
        final DocRef indexDocRef = DocRef
                .builder()
                .type(LuceneIndexDoc.TYPE)
                .uuid(indexShard.getIndexUuid())
                .build();
        if (!securityContext.hasDocumentPermission(indexDocRef,
                DocumentPermission.DELETE)) {
            throw new PermissionException(
                    securityContext.getUserRef(),
                    "You do not have permission to delete index shard");
        } else {
            indexShardWriterCache.delete(indexShard.getId());
        }
    }
Delete anything that has been marked to delete
stroom-index/stroom-index-impl/src/main/java/stroom/index/impl/IndexShardManager.java