# Few parents, many childs

**URL:** <https://discuss.elastic.co/t/few-parents-many-childs/46950>\
**Category:** Elasticsearch\
**Created:** [April 11, 2016, 7:35am UTC](https://discuss.elastic.co/t/few-parents-many-childs/46950 "2016-04-11T07:35:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jelmer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jelmer/32/3550_2.png) [@jelmer](https://discuss.elastic.co/u/jelmer)\
**Post date:** [April 11, 2016, 7:35am UTC](https://discuss.elastic.co/t/few-parents-many-childs/46950/1 "2016-04-11T07:35:33Z")

</div>

Hi. We have an index containing documents that have a title field and each document logically belongs to a category.

Now we'd like to explore the option of taking a title and based on this title recommending the category to place this item in.

One way i thought of to make this work is to create a document for each category and then making the items child documents of a category

That way i would be able to do a has\_child query, that would return the average score per category

However there are aprox 2000 categories and 10 million items. And i am wondering if I will run into any issues with this. Since it does not strike me as the typical usecase for parent child documents. Also if someone has a better idea to accomplish thr same goal i am open to suggestions

---

<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 5, 2017, 11:00pm UTC](https://discuss.elastic.co/t/few-parents-many-childs/46950/2 "2017-07-05T23:00:47Z")

</div>


