Gravatar for

Question by deepak_raghav, Jan 15, 2015 12:31 PM

Getting Parent and child grouped under parent

Is there a possibility to get the search results grouped with child - parent relationship. Suppose i have a parent A having child B & C and both B & C child have childs D,E,F. I want all these child results to be grouped under the same parent A. Is there a possible way to query the Rest API and get this result. A /\ B C /\ \ D E F This is example tree structure i need all these results categorized under same parent A without using any custom field. Please help me with a sample query if it is possible.

1 Reply
Gravatar for

Answer by Jean-François L'Heureux, Jan 15, 2015 1:06 PM

You can use the childField and parentField query parameters and parentResult when looking at the returned results. You may need custom fields if you don't already have a field on your child results that contains a parent result unique id.

Ask a question