// indices/put-mapping.asciidoc:149

[source, php]
----
$params = [
    'index' => 'my_index',
    'body' => [
        'mappings' => [
            'properties' => [
                'name' => [
                    'properties' => [
                        'first' => [
                            'type' => 'text',
                        ],
                    ],
                ],
            ],
        ],
    ],
];
$response = $client->indices()->create($params);
----
