# Indexing multiple child documents by query

**URL:** https://discuss.elastic.co/t/indexing-multiple-child-documents-by-query/356034
**Category:** Elastic Search
**Tags:** elastic-site-search
**Created:** [March 23, 2024, 1:19pm UTC](https://discuss.elastic.co/t/indexing-multiple-child-documents-by-query/356034 "2024-03-23T13:19:48Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Vikas\_Agrawal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_agrawal/32/123762_2.png) [@Vikas\_Agrawal](https://discuss.elastic.co/u/Vikas_Agrawal)
#### Post date: [March 23, 2024, 1:19pm UTC](https://discuss.elastic.co/t/indexing-multiple-child-documents-by-query/356034/1 "2024-03-23T13:19:48Z")

</div>

Is there any way I can index multiple child documents by query.

Let’s say I have 10K product document and I have customer to whom all 10k orders are applicable. I am storing product as parent and customer as child. Now I want to add same customer to all products.

Can I add 10k child, one under each parent, at once or by query instead of adding one by one?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [March 24, 2024, 7:13am UTC](https://discuss.elastic.co/t/indexing-multiple-child-documents-by-query/356034/2 "2024-03-24T07:13:28Z")

</div>

I am not aware of any way to do what you want within Elasticsearch so you may need to do it externally. If you are not already I would recommmend you use [the bulk API](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-bulk.html) to add the documents.

---

<div class="post-metadata">

### Author: ![Kartik\_Gajjar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kartik_gajjar/32/122424_2.png) [@Kartik\_Gajjar](https://discuss.elastic.co/u/Kartik_Gajjar)
#### Post date: [April 2, 2024, 7:40pm UTC](https://discuss.elastic.co/t/indexing-multiple-child-documents-by-query/356034/3 "2024-04-02T19:40:05Z")

</div>

Is there any option to normalize the data before loading to achieve the same?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [April 3, 2024, 5:36am UTC](https://discuss.elastic.co/t/indexing-multiple-child-documents-by-query/356034/4 "2024-04-03T05:36:08Z")

</div>

I do not understand what you mean. Could you please elaborate?

As far as I know there is no way to do this irrespective of how data is structured.

---

<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: [May 1, 2024, 5:36am UTC](https://discuss.elastic.co/t/indexing-multiple-child-documents-by-query/356034/5 "2024-05-01T05:36:18Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
