Skip to main content

HierarchyOperation

A single hierarchy expansion operation for the HierarchyTransformer.

Notes

Defines a single hierarchy expansion operation for the HierarchyTransformer. Specifies the source field, separator character, optional target field and target separator, and whether to use regex for the separator and preserve empty segments.

Usage

fromField: string
fromSeparator: string
keepEmptySegments: false
onSet: APPEND
regex: false
toField: string
toSeparator: string

Properties

PropertyTypeRequiredDefault
fromFieldstringNo-
fromSeparatorstringNo-
keepEmptySegmentsbooleanNofalse
onSetenumNo-
regexbooleanNofalse
toFieldstringNo-
toSeparatorstringNo-

Property Details

fromField

The source metadata field whose value is read as input. When not set, the document content is used as the source.

fromSeparator

The separator character or string used to delimit segments in the source hierarchy path.

keepEmptySegments

Whether empty segments are preserved when building the hierarchy. Default is false, so a value like /a//b yields /a and /a/b rather than an empty level in between.

onSet

Defines what to do when the target field already has one or more values. When unspecified, new values are appended to existing ones by default.

Allowed Values

  • APPEND
  • PREPEND
  • REPLACE
  • OPTIONAL

regex

A regular expression pattern used for matching.

toField

The target metadata field name where the extracted or computed value will be stored. If a field of the same name already exists, the behavior is controlled by onSet.

toSeparator

The separator character or string used to delimit segments in the target hierarchy path.