# Elasticsearch Re-indexing Issue

**URL:** <https://discuss.elastic.co/t/elasticsearch-re-indexing-issue/289529>\
**Category:** Elasticsearch\
**Created:** [November 18, 2021, 5:14am UTC](https://discuss.elastic.co/t/elasticsearch-re-indexing-issue/289529 "2021-11-18T05:14:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akshayyha\_Krishnamur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akshayyha_krishnamur/32/93758_2.png) [@Akshayyha\_Krishnamur](https://discuss.elastic.co/u/Akshayyha_Krishnamur)\
**Post date:** [November 18, 2021, 5:14am UTC](https://discuss.elastic.co/t/elasticsearch-re-indexing-issue/289529/1 "2021-11-18T05:14:19Z")

</div>

We use a single node environment since we have adopted Elasticsearch recently. We are facing Elasticsearch indexing issues when 4 subsequent indexing requests were made at approximately 50 - 100ms interval each. Elasticsearch updated few fields based on the current requests but retained other fields with the old values. The expectation is all fields should be updated based on the request passed.

We have also added setRetryOnConflict(1) in our code base so we are not really sure what could be the issue and probable solution.

Kindly help us with an approach.

---

<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 22, 2021, 12:17am UTC](https://discuss.elastic.co/t/elasticsearch-re-indexing-issue/289529/2 "2021-11-22T00:17:00Z")

</div>

Are these requests versioned at all?  
If not, that's probably the best approach to take.

---

<div class="post-metadata">

**Author:** ![Akshayyha\_Krishnamur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akshayyha_krishnamur/32/93758_2.png) [@Akshayyha\_Krishnamur](https://discuss.elastic.co/u/Akshayyha_Krishnamur)\
**Post date:** [November 22, 2021, 6:53am UTC](https://discuss.elastic.co/t/elasticsearch-re-indexing-issue/289529/3 "2021-11-22T06:53:04Z")

</div>

Hi.. Am not getting your question.

But we are seeing the indexing response from Elasticsearch holding the result as 'updated' also the version and seqNo are updated and the problem is some fields are updated and some are not

Also, we have setDocAsUpsert(true) in our code base.

---

<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 22, 2021, 8:02am UTC](https://discuss.elastic.co/t/elasticsearch-re-indexing-issue/289529/4 "2021-11-22T08:02:08Z")

</div>

What are some examples of the updates?

---

<div class="post-metadata">

**Author:** ![Akshayyha\_Krishnamur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akshayyha_krishnamur/32/93758_2.png) [@Akshayyha\_Krishnamur](https://discuss.elastic.co/u/Akshayyha_Krishnamur)\
**Post date:** [November 24, 2021, 6:02am UTC](https://discuss.elastic.co/t/elasticsearch-re-indexing-issue/289529/5 "2021-11-24T06:02:49Z")

</div>

For example, if we have an index data as below  
{  
"emp\_id": 123,  
"emp\_name":"sample",  
"company" :"company1",  
"experience":"10 years"  
}

And the data to be updated is as below  
Company - company2  
Experience - 13 years

The data updated in Elasticsearch is as below  
{  
"emp\_id": 123,  
"emp\_name":"sample",  
"company" :"company2", -\> updated  
"experience":"10 years" - \> not updated  
}

Similarly few fields are updating and few are not.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 24, 2021, 6:13am UTC](https://discuss.elastic.co/t/elasticsearch-re-indexing-issue/289529/6 "2021-11-24T06:13:07Z")

</div>

Are you performing scripted updates?

---

<div class="post-metadata">

**Author:** ![Akshayyha\_Krishnamur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akshayyha_krishnamur/32/93758_2.png) [@Akshayyha\_Krishnamur](https://discuss.elastic.co/u/Akshayyha_Krishnamur)\
**Post date:** [November 24, 2021, 9:40am UTC](https://discuss.elastic.co/t/elasticsearch-re-indexing-issue/289529/7 "2021-11-24T09:40:02Z")

</div>

Yes we are, through Elasticsearch Java client using setDocAsUpsert(true) and ActionRequestBuilder's get() method

---

<div class="post-metadata">

**Author:** ![Akshayyha\_Krishnamur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akshayyha_krishnamur/32/93758_2.png) [@Akshayyha\_Krishnamur](https://discuss.elastic.co/u/Akshayyha_Krishnamur)\
**Post date:** [December 21, 2021, 5:42am UTC](https://discuss.elastic.co/t/elasticsearch-re-indexing-issue/289529/8 "2021-12-21T05:42:27Z")

</div>

Hi Warkolm, kindly help us on this

---

<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:** [January 18, 2022, 5:43am UTC](https://discuss.elastic.co/t/elasticsearch-re-indexing-issue/289529/9 "2022-01-18T05:43:12Z")

</div>

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