IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Put Mappings API
editPut Mappings API
editThe Put Mappings API allows you to modify or add to an existing index’s mapping.
// Set the index and type $params = [ 'index' => 'my_index', 'type' => 'my_type2', 'body' => [ 'my_type2' => [ '_source' => [ 'enabled' => true ], 'properties' => [ 'first_name' => [ 'type' => 'keyword', 'analyzer' => 'standard' ], 'age' => [ 'type' => 'integer' ] ] ] ] ]; // Update the index mapping $client->indices()->putMapping($params);