1b8caf0a6741126c6d0ad83b56fce290.asciidoc 662 B

12345678910111213141516171819202122232425262728293031
  1. // indices/templates.asciidoc:146
  2. [source, php]
  3. ----
  4. $params = [
  5. 'name' => 'template_1',
  6. 'body' => [
  7. 'index_patterns' => [
  8. 'te*',
  9. ],
  10. 'settings' => [
  11. 'number_of_shards' => 1,
  12. ],
  13. 'aliases' => [
  14. 'alias1' => [
  15. ],
  16. 'alias2' => [
  17. 'filter' => [
  18. 'term' => [
  19. 'user' => 'kimchy',
  20. ],
  21. ],
  22. 'routing' => 'kimchy',
  23. ],
  24. '{index}-alias' => [
  25. ],
  26. ],
  27. ],
  28. ];
  29. $response = $client->indices()->putTemplate($params);
  30. ----