# Mapping between 2 Indexed documents; Parent/Child

**URL:** <https://discuss.elastic.co/t/mapping-between-2-indexed-documents-parent-child/18037>\
**Category:** Elasticsearch\
**Created:** [June 11, 2014, 9:07am UTC](https://discuss.elastic.co/t/mapping-between-2-indexed-documents-parent-child/18037 "2014-06-11T09:07:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gabsi\_Ibrahim](https://avatars.discourse-cdn.com/v4/letter/g/3bc359/32.png) [@Gabsi\_Ibrahim](https://discuss.elastic.co/u/Gabsi_Ibrahim)\
**Post date:** [June 11, 2014, 9:07am UTC](https://discuss.elastic.co/t/mapping-between-2-indexed-documents-parent-child/18037/1 "2014-06-11T09:07:40Z")

</div>

I have this relations between these objects :  
An account contains many categories, each categories contains many emails,  
each email has many attachment  
I'm trying to index all these objects in order to make a multicriteria  
search engine; bidirectionnel search.  
Example: I'm able to search for categories that has an email\_size inferior  
to 25K and I'm able also to search for emails that has cateogry\_name =  
"Inbox".  
Is it correct to index the whole parent document in the child document in  
this way:  
{ "\_id": 1  
"subject" : "ES..",  
"size" : "25",  
"\_parent" : {  
"\_id" : 475,  
"nameCategory": "Dossier des emails",  
"\_parent" : {  
"\_id" : 2,  
"nameAccount" : "Gmail"  
},  
},  
}

--  
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/a3877cc2-96f7-4c27-b925-8e8d8dc7f87d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a3877cc2-96f7-4c27-b925-8e8d8dc7f87d%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, 1:23am UTC](https://discuss.elastic.co/t/mapping-between-2-indexed-documents-parent-child/18037/2 "2017-07-06T01:23:23Z")

</div>


