Menu

pipeline enrich

Help
2004-03-26
2004-03-26
  • Santiago Begué

    Santiago Begué - 2004-03-26

    I don't understand how to use it, how can I wrote a enrichScript?
    Please some examples.

     
    • Dejan Krsmanovic

      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)

       
      • Santiago Begué

        Santiago Begué - 2004-03-26

        Thank's for your complete answer.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.