elasticsearch.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. return [
  3. /**
  4. * Here you can specify the connection to use when building a client.
  5. */
  6. 'connection' => 'default',
  7. /**
  8. * These are the available connections parameters that you can use to connect
  9. */
  10. 'connections' => [
  11. 'default' => [
  12. 'hosts' => [
  13. env('ELASTICSEARCH_HOST', 'http://localhost:9200'),
  14. ],
  15. 'user' => env('ELASTICSEARCH_USER', null),
  16. 'pass' => env('ELASTICSEARCH_PASS', null),
  17. ],
  18. /**
  19. * You can connect with API key authentication by setting the `api` key
  20. * instead of the `user` and `pass` keys.
  21. */
  22. 'api' => [
  23. 'hosts' => [
  24. env('ELASTICSEARCH_HOST', null),
  25. ],
  26. 'key' => env('ELASTICSEARCH_API_KEY', null),
  27. ],
  28. /**
  29. * You can connect to Elastic Cloud with the Cloud ID using the `cloud` key.
  30. */
  31. 'cloud' => [
  32. 'id' => env('ELASTICSEARCH_CLOUD_ID', null),
  33. /**
  34. * If you are authenticating with API KEY then set user and pass as null
  35. */
  36. 'api_key' => env('ELASTICSEARCH_API_KEY', null),
  37. /**
  38. * If you are authenticating with username and password then set api_key as null
  39. */
  40. 'user' => env('ELASTICSEARCH_USER', null),
  41. 'pass' => env('ELASTICSEARCH_PASS', null),
  42. ],
  43. ],
  44. /**
  45. * CA Bundle
  46. *
  47. * If you have the http_ca.crt certificate copied during the start of Elasticsearch
  48. * then the path here
  49. *
  50. * @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/connecting.html#auth-http
  51. */
  52. 'caBundle' => null,
  53. /**
  54. * Retries
  55. *
  56. * By default, the client will retry n times, where n = number of nodes in
  57. * your cluster. If you would like to disable retries, or change the number,
  58. * you can do so here.
  59. *
  60. * @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/set-retries.html
  61. */
  62. 'retries' => null,
  63. ];