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