How do I delete documents from the index?
That will delete the document numbered docNum from the index. Once a document is deleted it will not appear in TermDocs nor TermPositions enumerations.
Attempts to read its field with the document method will result in an error. The presence of this document may still be reflected in the docFreq statistic, though this will be corrected eventually as the index is further modified.
If you want to delete all (1 or more) documents that contain a specific term you may use:
Because a variable number of document can be affected by this method call this method returns the number of documents deleted.