# How to merge documents in an index while omitting the duplicates

**URL:** <https://discuss.elastic.co/t/how-to-merge-documents-in-an-index-while-omitting-the-duplicates/103000>\
**Category:** Elasticsearch\
**Created:** [October 6, 2017, 12:03pm UTC](https://discuss.elastic.co/t/how-to-merge-documents-in-an-index-while-omitting-the-duplicates/103000 "2017-10-06T12:03:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![happy0088](https://avatars.discourse-cdn.com/v4/letter/h/71c47a/32.png) [@happy0088](https://discuss.elastic.co/u/happy0088)\
**Post date:** [October 6, 2017, 12:03pm UTC](https://discuss.elastic.co/t/how-to-merge-documents-in-an-index-while-omitting-the-duplicates/103000/1 "2017-10-06T12:03:15Z")

</div>

I need to merge data from one index to another but the duplicate documents should not be overridden in the target index .

---

<div class="post-metadata">

**Author:** ![s1monw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1monw/32/3637_2.png) [@s1monw](https://discuss.elastic.co/u/s1monw)\
**Post date:** [October 13, 2017, 10:16am UTC](https://discuss.elastic.co/t/how-to-merge-documents-in-an-index-while-omitting-the-duplicates/103000/2 "2017-10-13T10:16:41Z")

</div>

you have to give the documents a new ID

---

<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 10, 2017, 10:24am UTC](https://discuss.elastic.co/t/how-to-merge-documents-in-an-index-while-omitting-the-duplicates/103000/3 "2017-11-10T10:24:51Z")

</div>

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