1da77e114459e0b77d78a3dcc8fae429.asciidoc 489 B

123456789101112131415161718192021222324
  1. // indices/put-mapping.asciidoc:114
  2. [source, php]
  3. ----
  4. $params = [
  5. 'index' => 'twitter-1',
  6. ];
  7. $response = $client->indices()->create($params);
  8. $params = [
  9. 'index' => 'twitter-2',
  10. ];
  11. $response = $client->indices()->create($params);
  12. $params = [
  13. 'index' => 'twitter-1,twitter-2',
  14. 'body' => [
  15. 'properties' => [
  16. 'user_name' => [
  17. 'type' => 'text',
  18. ],
  19. ],
  20. ],
  21. ];
  22. $response = $client->indices()->putMapping($params);
  23. ----