writer.addDocument(doc);
writer.optimize();
} catch (IOException e) {
LOG.log(Level.WARNING, "Unable to index workflow instance: ["
+ wInst.getId() + "]: Message: " + e.getMessage());
throw new InstanceRepositoryException(
"Unable to index workflow instance: [" + wInst.getId()
+ "]: Message: " + e.getMessage());
} finally {
try {
writer.close();