# Will upsert miss data or not

**URL:** <https://discuss.elastic.co/t/will-upsert-miss-data-or-not/64524>\
**Category:** Elasticsearch\
**Created:** [November 1, 2016, 8:08am UTC](https://discuss.elastic.co/t/will-upsert-miss-data-or-not/64524 "2016-11-01T08:08:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![makeyang](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@makeyang](https://discuss.elastic.co/u/makeyang)\
**Post date:** [November 1, 2016, 8:08am UTC](https://discuss.elastic.co/t/will-upsert-miss-data-or-not/64524/1 "2016-11-01T08:08:13Z")

</div>

let's say I insert a doc and it stays in translog without refresh.  
then I upsert(actually update it), will this upsert miss the doc due to it is not in the segment or not?

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [November 1, 2016, 9:05am UTC](https://discuss.elastic.co/t/will-upsert-miss-data-or-not/64524/2 "2016-11-01T09:05:45Z")

</div>

From [Making Changes Persistent | Elasticsearch: The Definitive Guide [2.x] | Elastic](https://www.elastic.co/guide/en/elasticsearch/guide/2.x/translog.html)

> When you try to retrieve, update, or delete a document by ID, it first checks the translog for any recent changes before trying to retrieve the document from the relevant segment.

Also, `refresh` doesn't clear the translog, `flush` does.

---

<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:07pm UTC](https://discuss.elastic.co/t/will-upsert-miss-data-or-not/64524/3 "2017-07-05T22:07:56Z")

</div>

Closed on July 5, 2017, 10:07pm UTC


