Class SplitTransformer
- All Implemented Interfaces:
Configurable<SplitTransformerConfig>,ConfigurableDocHandler<SplitTransformerConfig>,DocHandler
Splits an existing metadata value into multiple values based on a given value separator (the separator gets discarded). The "toField" argument is optional (the same field will be used to store the splits if no "toField" is specified"). Duplicates are removed.
Can be used both as a pre-parse (metadata or text content) or post-parse handler.
If no "fieldMatcher" expression is specified, the document content will be used. If the "fieldMatcher" matches more than one field, they will all be split and stored in the same multi-value metadata field.
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.
- See Also:
-
Field Summary
Fields inherited from interface com.norconex.commons.lang.config.Configurable
PROPERTYFields inherited from interface com.norconex.importer.handler.DocHandler
NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanbooleanhandle(DocHandlerContext docCtx) Perform any operations on a document.inthashCode()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.norconex.importer.handler.DocHandler
close, init
-
Constructor Details
-
SplitTransformer
public SplitTransformer()
-
-
Method Details
-
handle
Description copied from interface:DocHandlerPerform any operations on a document.- Specified by:
handlein interfaceDocHandler- Parameters:
docCtx- the document handling context- Returns:
falseto stop processing and reject a document ortrueto proceed to the next configured handler.- Throws:
IOException- An I/O exception of some sort has occurred
-
getConfiguration
- Specified by:
getConfigurationin interfaceConfigurable<SplitTransformerConfig>
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-