XmlFileCommitter
Local files of XML format.
Notes
File Format
The generated file content will contain any number of "upsert" and "delete" entries. Both types will contain the document "reference" and "metadata". The metadata is made of names followed by a value. Multi-value fields will appear as repeated entries with the same name and different value. The "upsert" entries also have a "content" tag. Like this example containing 1 "upsert" and 1 "delete":
<docs>
<upsert>
<reference>https://example.com/my-document.html</reference>
<metadata>
<meta name="title">My Example Document</meta>
<meta name="keywords">Exemple</meta>
<meta name="keywords">Demo</meta>
</metadata>
<content>
Document content goes here.
</content>
</upsert>
<delete>
<reference>https://example.com/i-was-deleted.html</reference>
<metadata>
<meta name="contentType">text/html</meta>
</metadata>
</delete>
</docs>
Examples
- YAML
- JSON
- XML
class: XmlFileCommitter
filePath: /path/to/committer.xml
{
"class": "XmlFileCommitter",
"filePath": "/path/to/committer.xml"
}
<class>XmlFileCommitter</class>
<filePath>/path/to/committer.xml</filePath>
Usage
Full configuration skeleton, with every option and its default
- YAML
- JSON
- XML
class: XmlFileCommitter
compress: false
directory: string
docsPerFile: 0
fieldMappings: {}
fileNamePrefix: string
fileNameSuffix: string
indent: 0
restrictions:
- fieldMatcher: {}
valueMatcher: {}
splitUpsertDelete: false
{
"class": "XmlFileCommitter",
"compress": false,
"directory": "string",
"docsPerFile": 0,
"fieldMappings": {},
"fileNamePrefix": "string",
"fileNameSuffix": "string",
"indent": 0,
"restrictions": [
{
"fieldMatcher": {},
"valueMatcher": {}
}
],
"splitUpsertDelete": false
}
<xmlFileCommitter>
<class>XmlFileCommitter</class>
<compress>false</compress>
<directory>string</directory>
<docsPerFile>0</docsPerFile>
<fieldMappings/>
<fileNamePrefix>string</fileNamePrefix>
<fileNameSuffix>string</fileNameSuffix>
<indent>0</indent>
<restrictions>
<restriction>
<fieldMatcher/>
<valueMatcher/>
</restriction>
</restrictions>
<splitUpsertDelete>false</splitUpsertDelete>
</xmlFileCommitter>
Properties
| Property | Type | Required | Default |
|---|---|---|---|
compress | boolean | No | false |
directory | string | No | - |
docsPerFile | integer | No | 0 |
fieldMappings | Record<string, string> | No | - |
fileNamePrefix | string | No | - |
fileNameSuffix | string | No | - |
indent | integer | No | -1 |
restrictions | PropertyMatcher[] | No | - |
splitUpsertDelete | boolean | No | false |
Property Details
compress
Compress the generated XML files using the GZIP file format.
directory
Local path where XML files will be written.
docsPerFile
Maximum number of documents per XML files.
fieldMappings
Mapping of source fields to target ones (XML tag name).
fileNamePrefix
A string prepended to generated file names to distinguish them from other output files.
fileNameSuffix
A string appended to generated file names (before the extension) to distinguish them from other output files.
indent
Number of indentation spaces. Default does not indent.
restrictions
Defines filter conditions that restrict which documents this committer processes. Documents not matching the restrictions are ignored by this committer.
splitUpsertDelete
When enabled, a single update operation is split into separate upsert and delete operations for compatibility with the target system.