1// indices/put-mapping.asciidoc:144
2
3[source, php]
4----
5$params = [
6    'index' => 'my_index',
7    'body' => [
8        'mappings' => [
9            'properties' => [
10                'name' => [
11                    'properties' => [
12                        'first' => [
13                            'type' => 'text',
14                        ],
15                    ],
16                ],
17            ],
18        ],
19    ],
20];
21$response = $client->indices()->create($params);
22----
23