DeleteTransformer
Delete the metadata fields provided
Notes
This functionality allows you to delete a document from the index. Exact field names (case-insensitive) to delete can be provided as well as a regular expression that matches one or many fields.
Parser Handler Compatibility
This functionality can be applied as either a pre-parse or post-parse handler.
Examples
The following example deletes all metadata fields starting with "X-".
- YAML
- JSON
- XML
handler:
class: DeleteTransformer
fieldMatcher:
method: REGEX
pattern: ^[Xx]-.*
{
"handler": {
"class": "DeleteTransformer",
"fieldMatcher": {
"method": "REGEX",
"pattern": "^[Xx]-.*"
}
}
}
<handler>
<class>DeleteTransformer</class>
<fieldMatcher>
<method>REGEX</method>
<pattern>^[Xx]-.*</pattern>
</fieldMatcher>
</handler>
Usage
Full configuration skeleton, with every option and its default
- YAML
- JSON
- XML
class: DeleteTransformer
fieldMatcher:
ignoreCase: false
ignoreDiacritic: false
matchEmpty: false
method: BASIC
negateMatches: false
partial: false
pattern: string
replaceAll: false
trim: false
label: string
{
"class": "DeleteTransformer",
"fieldMatcher": {
"ignoreCase": false,
"ignoreDiacritic": false,
"matchEmpty": false,
"method": "BASIC",
"negateMatches": false,
"partial": false,
"pattern": "string",
"replaceAll": false,
"trim": false
},
"label": "string"
}
<handler>
<class>DeleteTransformer</class>
<fieldMatcher>
<ignoreCase>false</ignoreCase>
<ignoreDiacritic>false</ignoreDiacritic>
<matchEmpty>false</matchEmpty>
<method>BASIC</method>
<negateMatches>false</negateMatches>
<partial>false</partial>
<pattern>string</pattern>
<replaceAll>false</replaceAll>
<trim>false</trim>
</fieldMatcher>
<label>string</label>
</handler>
Properties
| Property | Type | Required | Default |
|---|---|---|---|
fieldMatcher | TextMatcher | No | TextMatcher |
label | string | No | - |
Property Details
fieldMatcher
Matches document fields based on specified patterns and methods. Use this to restrict the handler to operate only on fields whose names satisfy the matcher criteria.
label
An optional, user-supplied label for this step in the importer pipeline. It has no effect on processing — it exists purely to help identify this step, for example in large configurations or in the visual configurator.