public void process ( DocumentAndOp doc , Analyzer analyzer ) throws IOException { if ( doc . getOp ( ) == DocumentAndOp . Op . DELETE || doc . getOp ( ) == DocumentAndOp . Op . UPDATE ) { deleteList . add ( doc . getTerm ( ) ) ; } if ( doc . getOp ( ) == DocumentAndOp . Op . INSERT || doc . getOp ( ) == DocumentAndOp . Op . UPDATE ) { if ( writer == null ) { // analyzer is null because we specify an analyzer with addDocument writer = createWriter ( ) ; } writer . addDocument ( doc . getDocument ( ) , analyzer ) ; numDocs ++ ; } }
This method is used by the index update mapper and process a document operation into the current intermediate form .