# How to update the elasticsearch Document which is indexed?

**URL:** <https://discuss.elastic.co/t/how-to-update-the-elasticsearch-document-which-is-indexed/45569>\
**Category:** Elasticsearch\
**Created:** [March 28, 2016, 9:01am UTC](https://discuss.elastic.co/t/how-to-update-the-elasticsearch-document-which-is-indexed/45569 "2016-03-28T09:01:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kartheek91](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@kartheek91](https://discuss.elastic.co/u/kartheek91)\
**Post date:** [March 28, 2016, 9:01am UTC](https://discuss.elastic.co/t/how-to-update-the-elasticsearch-document-which-is-indexed/45569/1 "2016-03-28T09:01:42Z")

</div>

I need help regarding update the elastic search document.

---

<div class="post-metadata">

**Author:** ![anhlqn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anhlqn/32/5454_2.png) [@anhlqn](https://discuss.elastic.co/u/anhlqn)\
**Post date:** [March 28, 2016, 6:19pm UTC](https://discuss.elastic.co/t/how-to-update-the-elasticsearch-document-which-is-indexed/45569/2 "2016-03-28T18:19:39Z")

</div>

From what I know, I don't think you can update existing documents in ES. You may have to reindex the data into new indexes, and if necessary, you can create aliases for new indexes. Certain mappings can be updated, but pretty limited.

---

<div class="post-metadata">

**Author:** ![unknownunknown](https://avatars.discourse-cdn.com/v4/letter/u/4da419/32.png) [@unknownunknown](https://discuss.elastic.co/u/unknownunknown)\
**Post date:** [March 28, 2016, 6:31pm UTC](https://discuss.elastic.co/t/how-to-update-the-elasticsearch-document-which-is-indexed/45569/3 "2016-03-28T18:31:06Z")

</div>

[https://www.elastic.co/guide/en/elasticsearch/reference/current/\_updating\_documents.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/_updating_documents.html)

I think it's a delete and a re-insert.

---

<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:** [March 28, 2016, 7:41pm UTC](https://discuss.elastic.co/t/how-to-update-the-elasticsearch-document-which-is-indexed/45569/4 "2016-03-28T19:41:37Z")

</div>

Nope, as per @unknownunknown's link you can do it.

---

<div class="post-metadata">

**Author:** ![thn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thn/32/8061_2.png) [@thn](https://discuss.elastic.co/u/thn)\
**Post date:** [March 28, 2016, 8:18pm UTC](https://discuss.elastic.co/t/how-to-update-the-elasticsearch-document-which-is-indexed/45569/5 "2016-03-28T20:18:00Z")

</div>

Here is an example of using Java API

[https://www.elastic.co/guide/en/elasticsearch/client/java-api/2.2/java-docs-update.html](https://www.elastic.co/guide/en/elasticsearch/client/java-api/2.2/java-docs-update.html)

Even though ES supports "update", it should be used with care because in theory, it's an expensive process. The index has no problem in servicing search requests while updating existing documents but the ranking of the search results will be affected due to the changes of the term-document matrix under the hood.

Don't be surprised to see the expected documents that used to be at the top of the search results now are not there. They may or may not depending on what was updated.

---

<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, 11:04pm UTC](https://discuss.elastic.co/t/how-to-update-the-elasticsearch-document-which-is-indexed/45569/6 "2017-07-05T23:04:34Z")

</div>


