# Update documents from multiple index based on condition

**URL:** <https://discuss.elastic.co/t/update-documents-from-multiple-index-based-on-condition/140460>\
**Category:** Elasticsearch\
**Created:** [July 18, 2018, 6:50am UTC](https://discuss.elastic.co/t/update-documents-from-multiple-index-based-on-condition/140460 "2018-07-18T06:50:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vijayakumarviji](https://avatars.discourse-cdn.com/v4/letter/v/f4b2a3/32.png) [@Vijayakumarviji](https://discuss.elastic.co/u/Vijayakumarviji)\
**Post date:** [July 18, 2018, 6:50am UTC](https://discuss.elastic.co/t/update-documents-from-multiple-index-based-on-condition/140460/1 "2018-07-18T06:50:35Z")

</div>

Elasticsearch Version: 6.0.0

I am currently having two indexes such as "user" and "purchase"

sample document :  
User Index:  
{  
"name": "Tamil",  
"id": "2"  
}

Purchase Index:  
{  
"product": "Apache RTR 200",  
"id": "p2",  
"userId": "2"  
}

we need the username in purchase index from user index based on the user Id.

is there any option avaibale in painless or someother ?

---

<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:** [August 15, 2018, 6:50am UTC](https://discuss.elastic.co/t/update-documents-from-multiple-index-based-on-condition/140460/2 "2018-08-15T06:50:38Z")

</div>

Closed on August 15, 2018, 6:50am UTC

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