In the newest version of lucene, 4.6, the IndexReader.deleteDocuments() no longer exists. Someone told me I should use the IndexWriter instead. However, the API document shows that:
void deleteDocuments(Query... queries)
deletes the document(s) matching any of the provided queries,
void deleteDocuments(Query query)
deletes the document(s) matching the provided query,
void deleteDocuments(Term... terms)
deletes the document(s) containing any of the terms, and
void deleteDocuments(Term term)
deletes the document(s) containing term.
There is no method for deleting the docs by document ID.