Method DeleteDocuments
DeleteDocuments(Term)
Deletes all documents that have a given term
indexed.
This is useful if one uses a document field to hold a unique ID string for
the document. Then to delete such a document, one merely constructs a
term with the appropriate field and the unique ID string as its text and
passes it to this method.
See DeleteDocument(Int32) for information about when this deletion will
become effective.
Declaration
public virtual int DeleteDocuments(Term term)
Parameters
Type | Name | Description |
---|---|---|
Term | term |
Returns
Type | Description |
---|---|
System.Int32 | The number of documents deleted |
Exceptions
Type | Condition |
---|---|
StaleReaderException | If the index has changed since this reader was opened |
CorruptIndexException | If the index is corrupt |
LockObtainFailedException | If another writer has this index open ( |