# Parent/Child relationship considerations

**URL:** <https://discuss.elastic.co/t/parent-child-relationship-considerations/22780>\
**Category:** Elasticsearch\
**Created:** [March 20, 2015, 3:51pm UTC](https://discuss.elastic.co/t/parent-child-relationship-considerations/22780 "2015-03-20T15:51:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joshua\_P](https://avatars.discourse-cdn.com/v4/letter/j/c89c15/32.png) [@Joshua\_P](https://discuss.elastic.co/u/Joshua_P)\
**Post date:** [March 20, 2015, 3:51pm UTC](https://discuss.elastic.co/t/parent-child-relationship-considerations/22780/1 "2015-03-20T15:51:06Z")

</div>

I've been reading up on parent/child relationships and had a couple  
questions:

On the Practical Considerations  
[http://www.elastic.co/guide/en/elasticsearch/guide/current/parent-child-performance.html](http://www.elastic.co/guide/en/elasticsearch/guide/current/parent-child-performance.html)  
page, it's suggested that you should "Use parent-child relationships  
sparingly, and only when there are many more children than parents." Is  
there a particular ratio of parent to children where the parent/child  
approach is better than using the nested type? What about if the number of  
children per parent varies widely (zero to upwards of 100 children).

If I have a structure like :  
{  
"Company" : {  
"Company\_id" : {  
"type": "integer"  
},  
"Company\_tx" : {  
"type" : "string"  
}  
"Deal\_Companies" : {  
"type" : "nested",  
"properties" : {  
"geocode": {  
"type" : "geo\_point"  
},  
"DealRole" : {  
"type" : "string" // possible values: "Buyer, Seller, Broker"  
},  
"LegalEntityName" : {  
"type" : "string"  
}  
}  
}  
}  
}

The idea is that a single company can have multiple legal entity names.  
Things I would want to know are how often that company was a buyer, seller,  
or broker and in what part of the country they were doing business in.  
Using aggregations, would I be able to answer questions like that?

Thanks!

--  
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/0bad5dd7-fe5a-4bfd-8158-a411e5a40887%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0bad5dd7-fe5a-4bfd-8158-a411e5a40887%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:25am UTC](https://discuss.elastic.co/t/parent-child-relationship-considerations/22780/2 "2017-07-06T00:25:21Z")

</div>


