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
<pathardepa...@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

Reply via email to