You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Kiran Jayakumar <ki...@gmail.com> on 2012/08/30 20:53:54 UTC

Static template column in DIH

Hi everyone,

I have defined a template column like this:

<entity name="books" query="select * from books">
<field name="Category" column="Category" template="Books"/>
</entity>

I dont have a field called Category in my query, but defined in schema.xml.
I'm expecting it to populate the Category field with a fixed value "Books".
It doesnt work. What am I missing ? Any help is much appreciated.

Thanks

Re: Static template column in DIH

Posted by Kiran Jayakumar <ki...@gmail.com>.
Thank you sir, works like a charm !

On Thu, Aug 30, 2012 at 12:06 PM, Dyer, James
<Ja...@ingramcontent.com>wrote:

> You might just be missing <entity ... transformer="TemplateTransformer" />
> .
>
> See http://wiki.apache.org/solr/DataImportHandler#TemplateTransformer
>
> James Dyer
> E-Commerce Systems
> Ingram Content Group
> (615) 213-4311
>
>
> -----Original Message-----
> From: Kiran Jayakumar [mailto:kiranjunique@gmail.com]
> Sent: Thursday, August 30, 2012 1:54 PM
> To: solr-user@lucene.apache.org
> Subject: Static template column in DIH
>
> Hi everyone,
>
> I have defined a template column like this:
>
> <entity name="books" query="select * from books">
> <field name="Category" column="Category" template="Books"/>
> </entity>
>
> I dont have a field called Category in my query, but defined in schema.xml.
> I'm expecting it to populate the Category field with a fixed value "Books".
> It doesnt work. What am I missing ? Any help is much appreciated.
>
> Thanks
>
>

RE: Static template column in DIH

Posted by "Dyer, James" <Ja...@ingramcontent.com>.
You might just be missing <entity ... transformer="TemplateTransformer" /> .

See http://wiki.apache.org/solr/DataImportHandler#TemplateTransformer

James Dyer
E-Commerce Systems
Ingram Content Group
(615) 213-4311


-----Original Message-----
From: Kiran Jayakumar [mailto:kiranjunique@gmail.com] 
Sent: Thursday, August 30, 2012 1:54 PM
To: solr-user@lucene.apache.org
Subject: Static template column in DIH

Hi everyone,

I have defined a template column like this:

<entity name="books" query="select * from books">
<field name="Category" column="Category" template="Books"/>
</entity>

I dont have a field called Category in my query, but defined in schema.xml.
I'm expecting it to populate the Category field with a fixed value "Books".
It doesnt work. What am I missing ? Any help is much appreciated.

Thanks