# Parent-child document relation problem

**URL:** <https://discuss.elastic.co/t/parent-child-document-relation-problem/23011>\
**Category:** Elasticsearch\
**Created:** [March 31, 2015, 3:41pm UTC](https://discuss.elastic.co/t/parent-child-document-relation-problem/23011 "2015-03-31T15:41:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Viacheslav\_Shalamov](https://avatars.discourse-cdn.com/v4/letter/v/3ec8ea/32.png) [@Viacheslav\_Shalamov](https://discuss.elastic.co/u/Viacheslav_Shalamov)\
**Post date:** [March 31, 2015, 3:41pm UTC](https://discuss.elastic.co/t/parent-child-document-relation-problem/23011/1 "2015-03-31T15:41:52Z")

</div>

Hi all, could you help me with little problem regarding parent-child  
documents relation?

I use elasticsearch v1.4.4.

Considering JSON, I have objects, each of them contains an array of  
sub-objects. Sub-objects contain some text fields.  
I need to maintain full-text-search on these objects and construct  
snippets. I need highlighting for building snippets.  
If I use nested objects, highlighting does not deal with them.  
Therefore, I use Parent-Child relationships.

Now I need to retrieve Parent-documents, which children match the  
query\_string. Furthermore, I need to get highlighted fields of matched  
children and associate each one(each child) with corresponding parent to  
construct snippets in my application.

Is it possible to accomplish my goal in one query?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/5e018b6c-8354-4600-822b-8956eb530237%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/5e018b6c-8354-4600-822b-8956eb530237%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:22am UTC](https://discuss.elastic.co/t/parent-child-document-relation-problem/23011/2 "2017-07-06T00:22:44Z")

</div>


