# How to add new data to particular field from another index?

**URL:** <https://discuss.elastic.co/t/how-to-add-new-data-to-particular-field-from-another-index/144075>\
**Category:** Elasticsearch\
**Created:** [August 13, 2018, 6:25am UTC](https://discuss.elastic.co/t/how-to-add-new-data-to-particular-field-from-another-index/144075 "2018-08-13T06:25:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cool\_arun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cool_arun/32/70465_2.png) [@cool\_arun](https://discuss.elastic.co/u/cool_arun)\
**Post date:** [August 13, 2018, 6:25am UTC](https://discuss.elastic.co/t/how-to-add-new-data-to-particular-field-from-another-index/144075/1 "2018-08-13T06:25:59Z")

</div>

I have two index one index having a field called "authorId" and another index have details belongs to that authorid. i want to bring the details to the first index, how to do this efficiently.

EXAMPLE:  
INDEX-1  
{  
"authorId": 1,  
"date": "23-2-2108"  
}

INDEX-2  
{  
"authorId": 1,  
"name": "arun",  
"age": 24  
}

RESULT I WANT  
INDEX-1  
{  
"authorId": 1,  
"date": "23-2-2108",  
"name": "arun",  
"age": 24  
}

---

<div class="post-metadata">

**Author:** ![jaddison](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jaddison](https://discuss.elastic.co/u/jaddison)\
**Post date:** [September 9, 2018, 9:06pm UTC](https://discuss.elastic.co/t/how-to-add-new-data-to-particular-field-from-another-index/144075/2 "2018-09-09T21:06:57Z")

</div>

Late reply, but I suspect the only approach here is to script it. For each doc in index-1:

- get data from index-1
- get data from index-2
- 'merge' the data by whatever rules you want
- update the doc in index-1

Might take a while, but seems the most practical. I'd consider getting index-1 results via `scan` and then getting the associated doc from index-2.

---

<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:** [October 7, 2018, 9:06pm UTC](https://discuss.elastic.co/t/how-to-add-new-data-to-particular-field-from-another-index/144075/3 "2018-10-07T21:06:58Z")

</div>

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