The operation Sync-Documents synchronizes one or more documents with the data record.
Input
The adapter expects an XML document with the following structure as input:
<?xml version="1.0" encoding="UTF-8"?>
<x4ai_adapter>
<doc>
<pageContent>Document text</pageContent>
<metadata>
<source>Required sourceKey for document</source>
<id>Optional</id>
<source_url>Optional</source_url>
<page>Optional</page>
<version>Optional</version>
</metadata>
</doc>
<doc>
<pageContent>Document text 2</pageContent>
<metadata>
<source>Required sourceKey for document</source>
<id>Optional</id>
<source_url>Optional</source_url>
<page>Optional</page>
<version>Optional</version>
</metadata>
</doc>
<doc>
<pageContent>Document text 3</pageContent>
<metadata>
<source>Required sourceKey for document</source>
<id>Optional</id>
<source_url>Optional</source_url>
<page>Optional</page>
<version>Optional</version>
</metadata>
</doc>
<chunkSize>100</chunkSize>
<chunkOverlap>10</chunkOverlap>
</x4ai_adapter>
The following elements are included in the input:
|
Element |
Description |
|---|---|
|
|
Enclosing element for the |
|
|
Enclosing element for the elements |
|
|
Page contents as text. |
|
|
Enclosing element for meta data. Contains the elements |
|
|
Unique source key (= |
|
|
(optional)
Possible values:
|
|
|
(optional) Page number of the document Possible values: Integer number |
|
|
(optional) Document version Possible values: Any string |
|
|
(optional) Maximum number of characters that a chunk can contain. Possible values: Integer number |
|
|
(optional) Number of characters that should overlap between two neighboring chunks. Possible values: Integer number |
Output
The adapter generates a XML document as output:
<?xml version="1.0" encoding="UTF-8"?>
<output>
<response>
<num_added>9</num_added>
<num_deleted>0</num_deleted>
<num_skipped>0</num_skipped>
<num_updated>0</num_updated>
</response>
</output>
The following elements can be contained in the output:
|
Element |
Description |
|---|---|
|
|
Enclosing element for the operation |
|
|
Enclosing element for the contents of the XML document |
|
|
Number of data sets added to a document. |
|
|
Number of deleted data sets of a document. Irrelevant for the operation |
|
|
Number of skipped data sets of a document. |
|
|
Number of updated data sets of a document. |