Update index that already have


(Chanpiseth Ros) #1

Hi everyone, I have a problem, when i try to update my index in elastic search, 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);


(David Pilato) #2

You can not create an index which already exist.

Use update settings API instead.


(Chanpiseth Ros) #3

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


(David Pilato) #4

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

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


(system) #5

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