Re: Problem using DIH templatetransformer to create uniqueKey: solved

2009-03-12 Thread Fergus McMenemie
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=(.*)

Problem using DIH templatetransformer to create uniqueKey

2009-02-13 Thread Fergus McMenemie
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,

Re: Problem using DIH templatetransformer to create uniqueKey

2009-02-13 Thread Noble Paul നോബിള്‍ नोब्ळ्
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

Re: Problem using DIH templatetransformer to create uniqueKey

2009-02-13 Thread Fergus McMenemie
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

Re: Problem using DIH templatetransformer to create uniqueKey

2009-02-13 Thread Fergus McMenemie
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

Re: Problem using DIH templatetransformer to create uniqueKey

2009-02-13 Thread Erik Hatcher
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

Re: Problem using DIH templatetransformer to create uniqueKey

2009-02-13 Thread Fergus McMenemie
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

Re: Problem using DIH templatetransformer to create uniqueKey

2009-02-13 Thread Noble Paul നോബിള്‍ नोब्ळ्
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

Re: Problem using DIH templatetransformer to create uniqueKey

2009-02-13 Thread Noble Paul നോബിള്‍ नोब्ळ्
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