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 Mark <st...@gmail.com> on 2010/12/28 22:29:47 UTC
Dynamic column names using DIH
Is there a way to create dynamic column names using the values returned
from the query?
For example:
<entity name="foo"
dataSource="my_database"
query="select * from foo where item_id=${item.id}">
<field column="title" name="${foo.somefield}_textsv"/>
</entity>
Re: Dynamic column names using DIH
Posted by Gora Mohanty <go...@mimirtech.com>.
On Wed, Dec 29, 2010 at 2:59 AM, Mark <st...@gmail.com> wrote:
> Is there a way to create dynamic column names using the values returned from
> the query?
>
> For example:
>
> <entity name="foo"
> dataSource="my_database"
> query="select * from foo where item_id=${item.id}">
> <field column="title" name="${foo.somefield}_textsv"/>
> </entity>
Not sure if that syntax will work, but you can use a transformer
to add a dynamic column, Please see
http://wiki.apache.org/solr/DataImportHandler#Transformer
Regards,
Gora