I want to set my custom mapping before index, how can i use it?
My mapping:
> $client = \Elasticsearch\ClientBuilder::create()->build();
$mappingFields = [ 'index' => 'staff', 'body' => [ 'mapping' => [ 'person' => [ 'properties' => [ 'first-name' => [ 'type' => 'string' ], ] ] ] ] ] $client->indices()->create($mappingFields); $params = [ '_index' => 'staff', '_type' => 'person', '_id' => 1, 'body' => [ 'first-name' => 'ABC', ] ]; $client->index($params);
And i always get this error message "error":"IndexAlreadyExistsException[[staff] already exists]","status":400}", Do i config or write something wrong? Could someone help me?
Thanks