@ MustBeLocked ( ELockType . WRITE ) public void updateDocuments ( @ Nullable final Term aDelTerm , @ Nonnull final Iterable < ? extends Iterable < ? extends IndexableField > > aDocs ) throws IOException { long nSeqNum ; if ( false ) { // Delete and than add nSeqNum = _getWriter ( ) . deleteDocuments ( aDelTerm ) ; nSeqNum = _getWriter ( ) . updateDocuments ( null , aDocs ) ; } else { // Update directly nSeqNum = _getWriter ( ) . updateDocuments ( aDelTerm , aDocs ) ; } if ( LOGGER . isDebugEnabled ( ) ) LOGGER . debug ( "Last seq# after updateDocuments is " + nSeqNum ) ; m_aWriterChanges . incrementAndGet ( ) ; }
Atomically deletes documents matching the provided delTerm and adds a block of documents with sequentially assigned document IDs such that an external reader will see all or none of the documents .