Page tree
Skip to end of metadata
Go to start of metadata


All documents sent to AIE have a mode that determines what happens with the documents when they reach the indexer. The default mode for the IngestDocument  class is the Add mode, which implies that all content will be added to the index, and that any existing content with the same ID will be replaced. In addition, the ChangeDocumentMode  transformer can be used to change document modes based on field values.

View incoming links.

Update vs Replace

By default, Add replaces any existing document in the index with the same document ID. Real-Time Updates can be made without replacing the other normal field values. In order to update these fields, the document mode must be set to Partial and other normal field values must not be set. (Exception: If the index has partition routing configured to operate on a field other than the document ID, you must specify a value for the routing field when performing bulk updates by ID. Failure to include a value for the routing field will cause Attivio to route documents to index partitions based on document-ID hash values, which may produce results inconsistent with your desired behavior. See Bulk Updates by ID and Partition Routing for more details.)

Refer to DocumentMode  javadoc for a full description of each document mode.

Setting the Document Mode Programatically

IngestDocument doc = new IngestDocument("docid1");
// 'Add' is the default mode but others can be set by calling setMode()
doc.setField("foo_r", "a real time field update");
documentClient.feed(doc); // Add the document.

To make an update live, a commit message, or refresh message (in the case of real-time updates) must be sent and processed by the indexer.

Main Article: Real-Time Updates

See the Creating and Submitting Documents code snippet for a more complete example of how to submit documents to AIE using the API.

  • No labels