# Old data shown after re-creating an index

**URL:** <https://discuss.elastic.co/t/old-data-shown-after-re-creating-an-index/164714>\
**Category:** Elasticsearch\
**Created:** [January 17, 2019, 10:49pm UTC](https://discuss.elastic.co/t/old-data-shown-after-re-creating-an-index/164714 "2019-01-17T22:49:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![razortt](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@razortt](https://discuss.elastic.co/u/razortt)\
**Post date:** [January 17, 2019, 10:49pm UTC](https://discuss.elastic.co/t/old-data-shown-after-re-creating-an-index/164714/1 "2019-01-17T22:49:28Z")

</div>

Hi

Apologies if this has been asked before.

I'm new with ES (6.3) and i'm working through the process of how I want to index all my documents.

What I have found is after I delete the index, tweak the mappings and re-import the documents, when I retrieve a document it's showing old data.

I have updated the JSON document that is bulk uploaded, but it never shows the new information.

Does the id for each document have to change every time you re-upload it? Because I have left the id the same assuming that when you delete an index, the documents would be deleted as well.

Thanks  
Simon

---

<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:** [January 17, 2019, 10:54pm UTC](https://discuss.elastic.co/t/old-data-shown-after-re-creating-an-index/164714/2 "2019-01-17T22:54:33Z")

</div>

If you delete the index and then reindex the data, there's zero chance Elasticsearch is holding onto old data because the old index no longer exists.

Any data that is being returned is based off the data that was (re)indexed into the new index.

---

<div class="post-metadata">

**Author:** ![razortt](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@razortt](https://discuss.elastic.co/u/razortt)\
**Post date:** [January 17, 2019, 11:10pm UTC](https://discuss.elastic.co/t/old-data-shown-after-re-creating-an-index/164714/3 "2019-01-17T23:10:25Z")

</div>

Hi Mark,

Thanks. I'll have to retry, perhaps I wasn't successfully deleting the index.

Is there any chance that my browser could cache the response?

Thanks  
Simon

---

<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:** [January 18, 2019, 1:06am UTC](https://discuss.elastic.co/t/old-data-shown-after-re-creating-an-index/164714/4 "2019-01-18T01:06:07Z")

</div>

I guess so, but I wouldn't start down that path yet.

What are the actual command you are running?

---

<div class="post-metadata">

**Author:** ![razortt](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@razortt](https://discuss.elastic.co/u/razortt)\
**Post date:** [January 18, 2019, 2:20am UTC](https://discuss.elastic.co/t/old-data-shown-after-re-creating-an-index/164714/5 "2019-01-18T02:20:29Z")

</div>

Hi Mark

I just ran through my commands, and of course it worked perfectly! Always the way 🙄

```
curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/_bulk?pretty' --data-binary @carq.json

health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open cars-2019.01.01 iNw3PouxQpa79TSLuHL-rA 5 1 10 0 50.6kb 50.6kb

DELETE /cars-2019.01.01
{
  "acknowledged": true
}

curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/_bulk?pretty' --data-binary @carq.json

```

Previously I do recall seeing the docs.deleted value being 9 or 10 when I had the issue.

Thanks for your responses!

Cheers,  
Simon

---

<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:** [January 18, 2019, 2:21am UTC](https://discuss.elastic.co/t/old-data-shown-after-re-creating-an-index/164714/6 "2019-01-18T02:21:45Z")

</div>

> [@razortt](#):
>
> Previously I do recall seeing the docs.deleted value being 9 or 10 when I had the issue.

That'd mean you were over writing the data again. So maybe your delete didn't work?

---

<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:** [February 15, 2019, 2:21am UTC](https://discuss.elastic.co/t/old-data-shown-after-re-creating-an-index/164714/7 "2019-02-15T02:21:53Z")

</div>

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