synchronized void update ( final Collection < String > remove , final Collection < Document > add ) throws IOException { if ( ! online . get ( ) ) { doUpdateOffline ( remove , add ) ; } else if ( modeHandler . getMode ( ) == IndexerIoMode . READ_WRITE && redoLog != null ) { doUpdateRW ( remove , add ) ; } else { doUpdateRO ( remove , add ) ; } }
Atomically updates the index by removing some documents and adding others .