# Elasticsearch delete or update a document should reflect in two indexes from server side

**URL:** <https://discuss.elastic.co/t/elasticsearch-delete-or-update-a-document-should-reflect-in-two-indexes-from-server-side/64977>\
**Category:** Elasticsearch\
**Created:** [November 4, 2016, 5:43am UTC](https://discuss.elastic.co/t/elasticsearch-delete-or-update-a-document-should-reflect-in-two-indexes-from-server-side/64977 "2016-11-04T05:43:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![banu](https://avatars.discourse-cdn.com/v4/letter/b/2acd7d/32.png) [@banu](https://discuss.elastic.co/u/banu)\
**Post date:** [November 4, 2016, 5:43am UTC](https://discuss.elastic.co/t/elasticsearch-delete-or-update-a-document-should-reflect-in-two-indexes-from-server-side/64977/1 "2016-11-04T05:43:30Z")

</div>

If I have two index, Ex: sample1 and sample2.  
If I delete or update a value in sample1 then the corresponding document should also deleted or updated in sample2?

Data : sample1 : {name: 'Tom', id: '1', city: 'xx', state, 'yy', country: 'zz'}  
sample2 : {id: '1', city: 'xx', state, 'yy', country: 'zz'}  
If I delete id: '1' then this document should be deleted from both the index from the server side itself. How to do this ?  
The problem will be if I delete the values separatley then if I end up in network issue after deleting value from one index the other index will have values how to avoid this ?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 4, 2016, 5:50am UTC](https://discuss.elastic.co/t/elasticsearch-delete-or-update-a-document-should-reflect-in-two-indexes-from-server-side/64977/2 "2016-11-04T05:50:05Z")

</div>

You need to issue deletes against each discrete index.

---

<div class="post-metadata">

**Author:** ![banu](https://avatars.discourse-cdn.com/v4/letter/b/2acd7d/32.png) [@banu](https://discuss.elastic.co/u/banu)\
**Post date:** [November 4, 2016, 7:03am UTC](https://discuss.elastic.co/t/elasticsearch-delete-or-update-a-document-should-reflect-in-two-indexes-from-server-side/64977/3 "2016-11-04T07:03:12Z")

</div>

I need to achieve by using multiple indices option

---

<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, 10:06pm UTC](https://discuss.elastic.co/t/elasticsearch-delete-or-update-a-document-should-reflect-in-two-indexes-from-server-side/64977/4 "2017-07-05T22:06:37Z")

</div>


