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 Delete
Declaration
public virtual int DeleteDocuments(Term term)
Parameters
Type | Name | Description |
---|---|---|
Term | term |
Returns
Type | Description |
---|---|
System. |
The number of documents deleted |
Exceptions
Type | Condition |
---|---|
Stale |
If the index has changed since this reader was opened |
Corrupt |
If the index is corrupt |
Lock |
If another writer has this index open ( |