Skip to main content

RenameTransformer

Rename metadata fields to different names.

Notes

Storing values in an existing field

If a target field with the same name already exists for a document, values will be added to the end of the existing value list. It is possible to change this default behavior by supplying a PropertySetter.

When using regular expressions, toField can also hold replacement patterns (e.g. $1, $2, etc).

Can be used both as a pre-parse or post-parse handler.

Examples

The above example renames a "dc.title" field to "title", overwriting any existing values in "title".

handler:
class: RenameTransformer
operations:
- toField: title
onSet: REPLACE
fieldMatcher:
method: REGEX
pattern: dc.title

Usage

Full configuration skeleton, with every option and its default
class: RenameTransformer
label: string
operations:
- fieldMatcher: {}
onSet: APPEND
toField: string

Properties

PropertyTypeRequiredDefault
labelstringNo-
operationsRenameOperation[]No-

Property Details

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.

operations

A list of DOM extraction operations to perform, each targeting a specific element selector and specifying what to extract and where to store it.