I think you have double mapping there:
*) select DOC_IDN as id
*) <field column="DOC_IDN" name="id" />
Both are mapping DOC_IDN to id, possibly with second overriding the
first (or shadowing).

Try not doing 'as' part in select and then look for .id . Or keep the
'as' part as just have explicit field definition in the second one:
<field column="id" />

Regards,
  Alex.
Personal website: http://www.outerthoughts.com/
LinkedIn: http://www.linkedin.com/in/alexandrerafalovitch
- Time is the quality of nature that keeps events from happening all
at once. Lately, it doesn't seem to be working.  (Anonymous  - via GTD
book)


On Fri, Jan 31, 2014 at 6:29 AM, tom <praveen...@yahoo.com> wrote:
> Hi,
> I am trying a simple transformer on data input using DIH, Solr 4.6. when I
> run the below query while DIH I get null values for new_url. what is wrong?
> even tried with "${document_solr.id}"
>
> the name is
>
> data-config.xml:
>
> <entity name="document_solr"
>         transformer="TemplateTransformer,LogTransformer"
>         query="select DOC_IDN as id, BILL_IDN as bill_id from document_solr"
>         logTemplate="The name is ${document_solr.DOC_IDN}" logLevel="debug" >
>
>         <field column="DOC_IDN" name="id" />
>         <field column="BILL_IDN" name="bill_id" />
>
>         <field column="new_url"  template="${document_solr.DOC_IDN}" />
> </entity>
>
>
>
> below stack trace:
> 8185946 [Thread-29] INFO  org.apache.solr.search.SolrIndexSearcher  û
> Opening Searcher@5a5f4cb7 realtime
> 8185960 [Thread-29] INFO  org.apache.solr.handler.dataimport.JdbcDataSource
> û Creating a connection for entity document_solr with URL:
> jdbc:oracle:thin:@vluedb01:1521:iedwdev
> 8186225 [Thread-29] INFO  org.apache.solr.handler.dataimport.JdbcDataSource
> û Time taken forgetConnection():265
> 8186226 [Thread-29] DEBUG org.apache.solr.handler.dataimport.JdbcDataSource
> û Executing SQL: select DOC_IDN as id, BILL_IDN as bill_id from
> document_solr
> 8186291 [Thread-29] TRACE org.apache.solr.handler.dataimport.JdbcDataSource
> û Time taken for sql :64
> 8186301 [Thread-29] DEBUG org.apache.solr.handler.dataimport.LogTransformer
> û The name is
> 8186303 [Thread-29] DEBUG org.apache.solr.handler.dataimport.LogTransformer
> û The name is
> 8186303 [Thread-29] DEBUG org.apache.solr.handler.dataimport.LogTransformer
> û The name is
>
>
> `Tom
>
>
>
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/TemplateTransformer-returns-null-values-tp4114539.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to