# Reindex API and child queries

**URL:** <https://discuss.elastic.co/t/reindex-api-and-child-queries/321025>\
**Category:** Elasticsearch\
**Tags:** reindex\
**Created:** [December 12, 2022, 11:34am UTC](https://discuss.elastic.co/t/reindex-api-and-child-queries/321025 "2022-12-12T11:34:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MattG1](https://avatars.discourse-cdn.com/v4/letter/m/9de053/32.png) [@MattG1](https://discuss.elastic.co/u/MattG1)\
**Post date:** [December 12, 2022, 11:34am UTC](https://discuss.elastic.co/t/reindex-api-and-child-queries/321025/1 "2022-12-12T11:34:48Z")

</div>

Hey,

We're investigating the best way to reindex our ES data after an index mapping update and came up with a way that could potentially work for us:

- new\_index is the index we'll be creating
- old\_index is the previous index

1. Create a new\_index using the updated index mapping
2. Reindex old\_index to new\_index
3. Add new\_index to our alias and swipe `is_write_true` from old\_index to new\_index
4. Reindex old\_index to new\_index (sync the changes that occurred since the reindexing/adding to alias was completed)
5. Drop old\_index

So I think the above mostly works however in our case we use child queries. Since old\_index and new\_index won't be in sync, how would child queries work? Do they look into both indexes (kinda doubt that) or would the results returned be outdated until step 4, the second reindexing has been completed?

Thanks,  
Matt

---

<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:** [January 9, 2023, 11:35am UTC](https://discuss.elastic.co/t/reindex-api-and-child-queries/321025/2 "2023-01-09T11:35:32Z")

</div>

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