I understand that the [subquery] transformer can help build a nested response 
when you know the structure in advance, but what if you have some BlockJoin 
indexed structure with grand children (as the original question in this 
thread), and you want to reconstruct the full document based on what is 
returned by the {!parent} query? I cannot see how to use [subquery] to do this?

Jan

On 2016/03/24 20:52:51, Mikhail Khludnev <mkhlud...@griddynamics.com> wrote: 
> I think you cal already kick tires and contribute a test case into
> https://issues.apache.org/jira/browse/SOLR-8208 that's already reachable
> there I believe, but I still working on core design.
> 
> On Thu, Mar 24, 2016 at 10:02 PM, Alisa Z. <prol...@mail.ru> wrote:
> 
> >  Hi all,
> >
> > I apologize for duplicating my previous message:
> > Solr 5.3:  anything similar to ChildDocTransformerFactory  that does not
> > flatten the hierarchical structure?
> >
> > However, it is still an open and interesting question:
> >
> > Following the example from  https://dzone.com/articles/using-solr-49-new
> > , let's say we are given multiple-level nested structure:
> >
> > <doc>
> >         <field name="id">1</field>
> >         <field name="name">I am the parent</field>
> >         <field name="cat">PARENT</field>
> >         <doc>
> >                 <field name="id">1.1</field>
> >                 <field name="name">I am the 1st child</field>
> >                 <field name="cat">CHILD</field>
> >         </doc>
> >         <doc>
> >                 <field name="id">1.2</field>
> >                 <field name="name">I am the 2nd child</field>
> >                 <field name="cat">CHILD</field>
> >                 <doc>
> >                         <field name="id">1.2.1</field>
> >                         <field name="name">I am a grandchildren</field>
> >                         <field name="cat">GRANDCHILD</field>
> >                 </doc>
> >         </doc>
> > </doc>
> >
> >
> > Querying
> > q={!parent which="cat:PARENT"}name:(I am +child)&fl=id,name,[child
> > parentFilter=cat:PARENT]
> >
> > will return flattened structure, where cat:CHILD and cat:GRANDCHILD
> > documents end up on the same level:
> > <doc>
> >         <field name="id">1</field>
> >         <field name="name">I am the parent</field>
> >         <field name="cat">PARENT</field>
> >         <doc>
> >                 <field name="id">1.1</field>
> >                 <field name="name">I am the 1st child</field>
> >                 <field name="cat">CHILD</field>
> >         </doc>
> >         <doc>
> >                 <field name="id">1.2</field>
> >                 <field name="name">I am the 2nd child</field>
> >                 <field name="cat">CHILD</field>
> >         </doc>
> >         <doc>
> >                 <field name="id">1.2.1</field>
> >                 <field name="name">I am a grandchildren</field>
> >                 <field name="cat">GRANDCHILD</field>
> >         </doc>
> > </doc> Indeed, the JAVAdocs for ChildDocTransformerFactory say: "This
> > transformer returns all descendants of each parent document in a flat list
> > nested inside the parent document".
> >
> > Yet is there any way to preserve the hierarchy in the response? I really
> > need to find the way to preserve the structure in the response.
> >
> > Thank you in advance!
> >
> > --
> > Alisa Zhila
> > ----------------------------------------------------------------------
> >
> 
> 
> 
> -- 
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
> 
> <http://www.griddynamics.com>
> <mkhlud...@griddynamics.com>
> 

Reply via email to