Enrich stage adds new attributes to current processing document. If you want to add attribute 'firstName' with value 'Santi' you shoud have something like this:
Note that value of attribute (as other pipeline stage config option values) is basicly some Velocity script which is evaluated for every document. So for example:
somestage.enrichScript.fileName=${document.name.substring(0,4)}.csv
will be different for every document. You can use other document attributes in enrichScripts for adding new attributes.
There are two other similiar stages for enriching (adding new attributes) documents - SqlEnrich use sql query for adding new attributes, and XPathExtract that use XPath expressions for adding new attributes (it is used with XML documents, off course)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't understand how to use it, how can I wrote a enrichScript?
Please some examples.
Enrich stage adds new attributes to current processing document. If you want to add attribute 'firstName' with value 'Santi' you shoud have something like this:
mystage.stageType=Enrich
mystage.enrichScript.firstName=Santi
mystage.nextStage=...
Note that value of attribute (as other pipeline stage config option values) is basicly some Velocity script which is evaluated for every document. So for example:
somestage.enrichScript.fileName=${document.name.substring(0,4)}.csv
will be different for every document. You can use other document attributes in enrichScripts for adding new attributes.
There are two other similiar stages for enriching (adding new attributes) documents - SqlEnrich use sql query for adding new attributes, and XPathExtract that use XPath expressions for adding new attributes (it is used with XML documents, off course)
Thank's for your complete answer.