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
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Put 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);