# How to add values of a specific fields from 2 different version in Index?

**URL:** <https://discuss.elastic.co/t/how-to-add-values-of-a-specific-fields-from-2-different-version-in-index/244696>\
**Category:** Logstash\
**Created:** [August 12, 2020, 10:21am UTC](https://discuss.elastic.co/t/how-to-add-values-of-a-specific-fields-from-2-different-version-in-index/244696 "2020-08-12T10:21:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NirmitJain](https://avatars.discourse-cdn.com/v4/letter/n/a9a28c/32.png) [@NirmitJain](https://discuss.elastic.co/u/NirmitJain)\
**Post date:** [August 12, 2020, 10:21am UTC](https://discuss.elastic.co/t/how-to-add-values-of-a-specific-fields-from-2-different-version-in-index/244696/1 "2020-08-12T10:21:04Z")

</div>

Hi ,  
I am looking for a way by which we can add value of a field already indexed with value of same field from new updated document to be indexed.  
for e.g.  
version 1 document:  
{  
"\_index" : "test\_index",  
"\_type" : "\_doc",  
"\_id" : "1",  
"\_version" : 1,  
"\_score" : 0.2876821,  
"\_source" : {  
"TRANSACTIONTYPE" : 12,  
"ISCORRELATED" : "1",  
"MOBILENUMBER" : "9765451087"  
}  
}

version 2 document:  
{  
"\_index" : "test\_index",  
"\_type" : "\_doc",  
"\_id" : "1",  
"\_version" : 2,  
"\_score" : 0.2876821,  
"\_source" : {  
"TRANSACTIONTYPE" : 10,  
"ISCORRELATED" : "1",  
"MOBILENUMBER" : "9765451087"  
}  
}

So after indexing version 2 document, TRANSACTIONTYPE should have 10 + 12 = 22 value. Any suggestions/help would be great.

---

<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:** [September 9, 2020, 10:21am UTC](https://discuss.elastic.co/t/how-to-add-values-of-a-specific-fields-from-2-different-version-in-index/244696/2 "2020-09-09T10:21:13Z")

</div>

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