} catch (IOException e) {
log.error("Could not clear index", e);
} finally {
ia.release(writer);
if (ta != null) {
ta.refresh();
}
}
log.debug("Finished clearing index.");
} else {
log.error("Index does not seem to be a Lucene index. Therfore no " + "clearing will be done.");