// indices/put-mapping.asciidoc:262

[source, php]
----
$params = [
    'index' => 'my_index',
    'body' => [
        'properties' => [
            'city' => [
                'type' => 'text',
                'fields' => [
                    'raw' => [
                        'type' => 'keyword',
                    ],
                ],
            ],
        ],
    ],
];
$response = $client->indices()->putMapping($params);
----
