// indices/templates.asciidoc:20

[source, php]
----
$params = [
    'name' => 'template_1',
    'body' => [
        'index_patterns' => [
            'te*',
            'bar*',
        ],
        'settings' => [
            'number_of_shards' => 1,
        ],
        'mappings' => [
            '_source' => [
                'enabled' => false,
            ],
            'properties' => [
                'host_name' => [
                    'type' => 'keyword',
                ],
                'created_at' => [
                    'type' => 'date',
                    'format' => 'EEE MMM dd HH:mm:ss Z yyyy',
                ],
            ],
        ],
    ],
];
$response = $client->indices()->putTemplate($params);
----
