# Update index that already have

**URL:** <https://discuss.elastic.co/t/update-index-that-already-have/102503>\
**Category:** Elasticsearch\
**Created:** [October 3, 2017, 2:54am UTC](https://discuss.elastic.co/t/update-index-that-already-have/102503 "2017-10-03T02:54:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chanpiseth\_Ros](https://avatars.discourse-cdn.com/v4/letter/c/c4cdca/32.png) [@Chanpiseth\_Ros](https://discuss.elastic.co/u/Chanpiseth_Ros)\
**Post date:** [October 3, 2017, 2:54am UTC](https://discuss.elastic.co/t/update-index-that-already-have/102503/1 "2017-10-03T02:54:36Z")

</div>

Hi everyone, I have a problem, when i try to update my index in Elasticsearch, that index has already created before, and i get the error with this message:

**Exception : {"error":"IndexAlreadyExistsException[[person] already exists]","status":400}**

And this is my code:

> $param = [  
> 'index' =\> 'person',  
> 'body' =\>   
> ];  
> ClientBuilder::indices()-\>create($param);

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 3, 2017, 5:06am UTC](https://discuss.elastic.co/t/update-index-that-already-have/102503/2 "2017-10-03T05:06:02Z")

</div>

You can not create an index which already exist.

Use update settings API instead.

---

<div class="post-metadata">

**Author:** ![Chanpiseth\_Ros](https://avatars.discourse-cdn.com/v4/letter/c/c4cdca/32.png) [@Chanpiseth\_Ros](https://discuss.elastic.co/u/Chanpiseth_Ros)\
**Post date:** [October 3, 2017, 6:45am UTC](https://discuss.elastic.co/t/update-index-that-already-have/102503/3 "2017-10-03T06:45:19Z")

</div>

I have found a function call putMapping() for update, but while i use it, it's error with this message:  
type is required for Put

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 3, 2017, 7:03am UTC](https://discuss.elastic.co/t/update-index-that-already-have/102503/4 "2017-10-03T07:03:26Z")

</div>

Put mapping is not the right method. Have a look at [https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-update-settings.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/indices-update-settings.html)

I don't know exactly how it translates to your programming language though.

---

<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:** [October 31, 2017, 7:03am UTC](https://discuss.elastic.co/t/update-index-that-already-have/102503/5 "2017-10-31T07:03:44Z")

</div>

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