ConnectorLib Java 25.2
ConnectorLib Java SDK Programming Guide

# 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 doc = new DocInfo(
              task.getTaskConfig(),
              "http://www.example.com/testDocument.doc",
              "testDocument.doc",
              true);

           doc.getDoc().addFieldValue("MyField", "My Value");
           doc.getDoc().addFieldValue("SecondField", "First value");
           doc.getDoc().addFieldValue("SecondField", "Second value");
           task.getIngester().replace(doc);

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.

Copyright 2025 Open Text
Version 25.2 | Last updated April 2025

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: Knowledge Discovery ConnectorLib Java 25.2

Topic Title: Ingest Replace