Open topic with navigation

# Ingest Replace

The `Replace` method is short-hand for performing a `Remove` followed by an ``Add``. You can use this method when a document in a repository has been changed.

           DocInfo docInfo = task.docInfoBuilder().createDocInfo(
              "http://www.example.com/testDocument.doc",
              "testDocument.doc",
              true);

           Metadata metadata = docInfo.doc().metadata();
           metadata.addField("MyField", "New Value");
           metadata.addField("SecondField", "Only one value now");

           task.ingester().replace(docInfo);

This example is very similar to the example for Ingest Add. It might be used in the `synchronize` action when `testDocument.doc` has been modified. In the ingestion target, both the content of the file and the metadata fields are replaced.

© 2018 Micro Focus or one of its affiliates | Send documentation feedback to Micro Focus Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm