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 Tanya Bompi <ta...@gmail.com> on 2018/09/21 20:05:53 UTC

Nested entity unrolled record

Hi,
  I am wondering if with a nested entity using the DataImportHandler, if
its possible to unroll the parent document with each of the child document
as a separate entry in the index.
I am using Solr 7.4.0 version.

For eg.
<entity name="Parent"  query="select Id, Name, RecordKey from table1">
    <field column="Id" name="id"/>
    <field column="Name" name="name"/>
    <entity name="Child" query="select RecordKey, Country from table2"
cacheImpl=SortedMapBackedCache" cacheKey="RecordKey" cacheLookup="Parent.
RecordKey" >
          <field column="Country" name="Country"/>
    </entity>
</entity>

So what i would desire the index to create multiple entries for each
Id,Name,Country combination.
Currently with the above config it combines all the entries of country
together in a single field for each Parent record.

What would the change look like? In my scenario, the child table has
multiple fields and combining all the data together for each field is not
what I desire.

Kindly let me know.
Thanks,
Tanya

Re: Nested entity unrolled record

Posted by Mikhail Khludnev <mk...@apache.org>.
Tanya, have you tried to designate it by  rootEntity attribute?

On Fri, Sep 21, 2018 at 11:06 PM Tanya Bompi <ta...@gmail.com> wrote:

> Hi,
>   I am wondering if with a nested entity using the DataImportHandler, if
> its possible to unroll the parent document with each of the child document
> as a separate entry in the index.
> I am using Solr 7.4.0 version.
>
> For eg.
> <entity name="Parent"  query="select Id, Name, RecordKey from table1">
>     <field column="Id" name="id"/>
>     <field column="Name" name="name"/>
>     <entity name="Child" query="select RecordKey, Country from table2"
> cacheImpl=SortedMapBackedCache" cacheKey="RecordKey" cacheLookup="Parent.
> RecordKey" >
>           <field column="Country" name="Country"/>
>     </entity>
> </entity>
>
> So what i would desire the index to create multiple entries for each
> Id,Name,Country combination.
> Currently with the above config it combines all the entries of country
> together in a single field for each Parent record.
>
> What would the change look like? In my scenario, the child table has
> multiple fields and combining all the data together for each field is not
> what I desire.
>
> Kindly let me know.
> Thanks,
> Tanya
>


-- 
Sincerely yours
Mikhail Khludnev