// 1. Open Index Reader
File indexFile = new File(indexPath);
Directory directory = FSDirectory.open(indexFile);
IndexReader indexReader = IndexReader.open(directory);
log.info("befor delete: indexReader.numDocs()=" + indexReader.numDocs());
// 2. Delete old Document
// loop over all documents in updateQueue
for (int i = 0; i < updateCopy.size(); i++) {
String resourceUrl = updateCopy.get(i).get(OlatDocument.RESOURCEURL_FIELD_NAME);
Term term = new Term(OlatDocument.RESOURCEURL_FIELD_NAME, resourceUrl );