lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexandre Rafalovitch <arafa...@gmail.com>
Subject Re: Script Transformer Help
Date Thu, 17 Jul 2014 04:38:37 GMT
Have you tried putting the transformer on the inner entity definition?
It's like a nested loop and you just put it in the outer loop.

Regards,
   Alex.
Personal: http://www.outerthoughts.com/ and @arafalov
Solr resources: http://www.solr-start.com/ and @solrstart
Solr popularizers community: https://www.linkedin.com/groups?gid=6713853


On Thu, Jul 17, 2014 at 11:29 AM, pavan patharde
<pathardepavan@gmail.com> wrote:
> Hi All,
>
> I have data-config.xml as below:Script Transformer is omitted.
> <dataConfig>
> <dataSource driver="org.hsqldb.jdbcDriver"­­
> url="jdbc:hsqldb:/temp/example/ex"­­ user="sa" />
>
> <script><![CDATA[                function f1(row)        {
>        row.put('message', 'Hello World!');                    return
> row;                }        ]]></script>
>
>
> <document name="products">
> <entity name="item" query="select NAME,BSIN from items"
> transformer="script:f1">
> <field column="NAME" name="id" />
> <field column="BSIN" name="bsin" />
>
> <entity name="brands" query="select brandname from brand where
> bsin='${item.BSIN}'" ­­>
> <field name="brand" column="BRAND" />
> <field name="cname" column="namedesc"  />
> </entity>
>
> </entity>
> </document>
> </dataConfig>
>
> I am able to access NAME and BSIN in the function f1. I am not able to
> access the brand and cname. Is there any way i can access brand and cname
> from child entity in script transformer ?
> Thanks in advance.
>
> Regards,
> Pavan .P.Patharde

Mime
View raw message