>It took me a while to understand that to use the Template Transfomer
>(http://lucene.apache.org/solr/api/org/apache/solr/handler/dataimport/TemplateTransformer.html),
>all building variable names (e.g. ${e.firstName} ${e.lastName} etc). can not
>contain null values. I hope the parser can do a better job explaining it.
>Also it will be nice to simple pad the null value will blank string. Should
>this be considered as an enhancement?
>-- 
>View this message in context: 
>http://www.nabble.com/DataImportHandler-Template-Transformer-tp23609267p23609267.html
>Sent from the Solr - User mailing list archive at Nabble.com.


I ran into this earlier, you may way to view the thread 
  "Problem using DIH templatetransformer to create uniqueKey"

There is extra code added within Template Transfomer that stops
the transform if one of the fields is not defined. However, I
was happy enough to use regexp transformer instead. I think there
probably is a requirement to support both types of behavior, but
of course it has to be documented.


>Template transformer will fail to return if a variable if undefined,
>however the regex transformer does still return. So where the
>following would fail:-
>
><field column="id" template="${jc.fileAbsolutePath}${x.vurl}" />
>
>This can be used instead:-
>
><field column="id" regex="^(.*)$" relpaceWith="$1${x.vurl}" 
>sourceColName="fileAbsolutePath" />
>
>So I guess we have the best of both worlds!


Regards Fergus.
-- 

===============================================================
Fergus McMenemie               Email:fer...@twig.me.uk
Techmore Ltd                   Phone:(UK) 07721 376021

Unix/Mac/Intranets             Analyst Programmer
===============================================================

Reply via email to