12345678910111213141516171819202122232425262728293031 |
- // indices/templates.asciidoc:146
- [source, php]
- ----
- $params = [
- 'name' => 'template_1',
- 'body' => [
- 'index_patterns' => [
- 'te*',
- ],
- 'settings' => [
- 'number_of_shards' => 1,
- ],
- 'aliases' => [
- 'alias1' => [
- ],
- 'alias2' => [
- 'filter' => [
- 'term' => [
- 'user' => 'kimchy',
- ],
- ],
- 'routing' => 'kimchy',
- ],
- '{index}-alias' => [
- ],
- ],
- ],
- ];
- $response = $client->indices()->putTemplate($params);
- ----
|