Document updatedDocument = null;
try {
searcher = reader.createSearcher();
LuceneHits hits = searcher.search(new TermQuery(identifierTerm));
checkHitsForUpdate(hits);
updatedDocument = documentModifier.updateDocument(hits.doc(0));
} catch(Exception ex) {
throw new LuceneIndexAccessException("Error during updating a document.", ex);
} finally {
SearcherFactoryUtils.closeSearcher(searcher);
IndexReaderFactoryUtils.releaseIndexReader(indexFactory, reader);