# Create multiple document depending on conditions

**URL:** <https://discuss.elastic.co/t/create-multiple-document-depending-on-conditions/202534>\
**Category:** Elasticsearch\
**Created:** [October 7, 2019, 1:00pm UTC](https://discuss.elastic.co/t/create-multiple-document-depending-on-conditions/202534 "2019-10-07T13:00:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JjOon](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@JjOon](https://discuss.elastic.co/u/JjOon)\
**Post date:** [October 7, 2019, 1:00pm UTC](https://discuss.elastic.co/t/create-multiple-document-depending-on-conditions/202534/1 "2019-10-07T13:00:58Z")

</div>

Hi there !

I am quite new with Elastic.  
I would like to know if there is a functionnality allowing to create multiple index depending on a condition ? (like an update\_by\_query can do)

My problem is the following one :

- I have an entity Parent (with his own index and some documents)
- I have an entity Child (with his own index and some documents)

The problem is: information about Parent are in my document Child (with UUID=123456)

So if I update a document of Parent, I have to do all these action in Child :

- Update all documents of Child which are related to Parent UUID 123456 and set their EndDate to Today()
- Create all these updated document, with a startdate to Today, and apply my modifications

I would like to know if this is possible or not.  
We manage snapshot by ourselves actually.

Thanks a lot for your help ! 🙂

---

<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:** [November 4, 2019, 1:00pm UTC](https://discuss.elastic.co/t/create-multiple-document-depending-on-conditions/202534/2 "2019-11-04T13:00:58Z")

</div>

Closed on November 4, 2019, 1:00pm UTC

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