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 yliu <yl...@mathworks.com> on 2015/01/08 15:53:16 UTC

How to return child documents with parent

Hi,

What is the best way to return both parent document and child documents in
one query?  I used SolrJ to create a document and added a few child
documents using addChildDocuments() method and indexed the parent document. 
All documents are indexed successfully (parent and children).  

When I tried to retrieve the parent document along with the child documents. 
I used expand=true&expand.field=_root_.  I was able to get the parent back
in "result" section and children in "expandedResults" section.  Is there
some other type of query I should use so I can get the child documents back
as children instead of expanded result?

Thanks,

Y



--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-return-child-documents-with-parent-tp4178081.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How to return child documents with parent

Posted by yliu <yl...@mathworks.com>.
Thanks.  That solved my problem.

Y



--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-return-child-documents-with-parent-tp4178081p4178378.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How to return child documents with parent

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Did you check [child] at
https://cwiki.apache.org/confluence/display/solr/Transforming+Result+Documents
?

On Thu, Jan 8, 2015 at 5:53 PM, yliu <yl...@mathworks.com> wrote:

> Hi,
>
> What is the best way to return both parent document and child documents in
> one query?  I used SolrJ to create a document and added a few child
> documents using addChildDocuments() method and indexed the parent document.
> All documents are indexed successfully (parent and children).
>
> When I tried to retrieve the parent document along with the child
> documents.
> I used expand=true&expand.field=_root_.  I was able to get the parent back
> in "result" section and children in "expandedResults" section.  Is there
> some other type of query I should use so I can get the child documents back
> as children instead of expanded result?
>
> Thanks,
>
> Y
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/How-to-return-child-documents-with-parent-tp4178081.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mk...@griddynamics.com>