Folks,
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=(.*)
Hello,
templatetransformer behaves rather ungracefully if one of the replacement
fields is missing.
I am parsing a single XML document into multiple separate solr documents.
It turns out that none of the source documents fields can be used to create
a uniqueKey alone. I need to combine two,
the intent was to not to make a partial string if some of the variable
are missing
probably we can enhance TemplateTransformer by using an extra
attribute on the field
field column=id template=${jc.fileAbsolutePath}${x.vurl}
ignoreMissingVariables=true/
then it can just resolve with whatever
Hello,
templatetransformer behaves rather ungracefully if one of the replacement
fields is missing.
Looking at TemplateString.java I see that left to itself fillTokens would
replace a missing variable with . It is an extra check in TemplateTransformer
that is throwing the warning and stopping
Paul,
Following up your usenet sussgetion:
field column=id template=${jc.fileAbsolutePath}${x.vurl}
ignoreMissingVariables=true/
and to add more to what I was thinking...
if the field is undefined in the input document, but the schema.xml
does allow a default value, then TemplateTransformer
What about having the template transformer support ${field:default}
syntax? I'm assuming it doesn't support that currently right? The
replace stuff in the config files does though.
Erik
On Feb 13, 2009, at 8:17 AM, Fergus McMenemie wrote:
Paul,
Following up your usenet
Hmmm. Just gave that a go! No luck
But how many layers of defaults do we need?
Rgds Fergus
What about having the template transformer support ${field:default}
syntax? I'm assuming it doesn't support that currently right? The
replace stuff in the config files does though.
Erik
On Fri, Feb 13, 2009 at 10:17 AM, Fergus McMenemie fer...@twig.me.uk wrote:
Paul,
Following up your usenet sussgetion:
field column=id template=${jc.fileAbsolutePath}${x.vurl}
ignoreMissingVariables=true/
and to add more to what I was thinking...
if the field is undefined in the input
On Fri, Feb 13, 2009 at 11:04 AM, Erik Hatcher
e...@ehatchersolutions.com wrote:
What about having the template transformer support ${field:default} syntax?
this is the only usecase for this. this can be easily achieved with a
custom Transformer
I'm assuming it doesn't support that currently