code: public void map(DocumentID key, LineDocTextAndOp value,
        OutputCollector<DocumentID, DocumentAndOp> output, Reporter reporter)
        throws IOException {
  
      DocumentAndOp.Op op = value.getOp();
      Document doc = null;
      Term term = null;
  
      if (op == DocumentAndOp.Op.INSERT || op == DocumentAndOp.Op.UPDATE) {
        doc = new Document();
        doc.add(new Field(docidFieldName, key.getText().toString(),
            Field.Store.YES, Field.Index.UN_TOKENIZED));
        doc.add(new Field(contentFieldName, value.getText().toString(),
            Field.Store.NO, Field.Index.TOKENIZED));
      }
  
      if (op == DocumentAndOp.Op.DELETE || op == DocumentAndOp.Op.UPDATE) {
        term = new Term(docidFieldName, key.getText().toString());
      }
  
      output.collect(key, new DocumentAndOp(op, doc, term));
    }
docs: /* (non-Javadoc)
  @see org.apache.hadoop.mapred.Mapper#map(java.lang.Object, java.lang.Object, org.apache.hadoop.mapred.OutputCollector, org.apache.hadoop.mapred.Reporter)