- PHP Client: other versions:
- Overview
- Quickstart
- Installation
- Configuration
- Index Operations
- Indexing Operations
- Search Operations
- The Connection Pool
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'; $params['type'] = 'my_type2'; // Adding a new type to an existing index $myTypeMapping2 = array( '_source' => array( 'enabled' => true ), 'properties' => array( 'first_name' => array( 'type' => 'string', 'analyzer' => 'standard' ), 'age' => array( 'type' => 'integer' ) ) ); $params['body']['my_type2'] = $myTypeMapping2; // Update the index mapping $client->indices()->putMapping($params);
Was this helpful?
Thank you for your feedback.