softUpdateDocuments

fun softUpdateDocuments(term: Term?, docs: Iterable<Iterable<IndexableField>>, vararg softDeletes: Field): Long

Expert: Atomically updates documents matching the provided term with the given doc-values fields and adds a block of documents with sequentially assigned document IDs, such that an external reader will see all or none of the documents.

One use of this API is to retain older versions of documents instead of replacing them. The existing documents can be updated to reflect they are no longer current while atomically adding new documents at the same time.

In contrast to .updateDocuments this method will not delete documents in the index matching the given term but instead update them with the given doc-values fields which can be used as a soft-delete mechanism.

See .addDocuments and .updateDocuments.

Return

The #sequence_number for this operation

Throws

if the index is corrupt

IOException

if there is a low-level IO error