Method UpdateDocument
UpdateDocument(Term, IEnumerable<IIndexableField>)
Updates a document by first deleting the document(s)
containing term
and then adding the new
document. The delete and then add are atomic as seen
by a reader on the same index (flush may happen only after
the add).
NOTE: if this method hits an
Declaration
public virtual void UpdateDocument(Term term, IEnumerable<IIndexableField> doc)
Parameters
Type | Name | Description |
---|---|---|
Term | term | the term to identify the document(s) to be deleted |
IEnumerable<IIndexableField> | doc | the document to be added |
Exceptions
Type | Condition |
---|---|
CorruptIndexException | if the index is corrupt |
UpdateDocument(Term, IEnumerable<IIndexableField>, Analyzer)
Updates a document by first deleting the document(s)
containing term
and then adding the new
document. The delete and then add are atomic as seen
by a reader on the same index (flush may happen only after
the add).
NOTE: if this method hits an
Declaration
public virtual void UpdateDocument(Term term, IEnumerable<IIndexableField> doc, Analyzer analyzer)
Parameters
Type | Name | Description |
---|---|---|
Term | term | the term to identify the document(s) to be deleted |
IEnumerable<IIndexableField> | doc | the document to be added |
Analyzer | analyzer | the analyzer to use when analyzing the document |
Exceptions
Type | Condition |
---|---|
CorruptIndexException | if the index is corrupt |