2016-01-07 19:16:37 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
2016-09-30 00:26:31 +02:00
|
|
|
/**
|
|
|
|
* You can specify one of several different connections when building an
|
|
|
|
* Elasticsearch client.
|
|
|
|
*
|
|
|
|
* Here you may specify which of the connections below you wish to use
|
|
|
|
* as your default connection when building an client. Of course you may
|
|
|
|
* use create several clients at once, each with different configurations.
|
|
|
|
*/
|
2021-03-29 02:15:22 +02:00
|
|
|
|
2016-09-30 00:26:31 +02:00
|
|
|
'defaultConnection' => 'default',
|
|
|
|
|
|
|
|
/**
|
|
|
|
* These are the connection parameters used when building a client.
|
|
|
|
*/
|
2021-03-29 02:15:22 +02:00
|
|
|
|
2016-09-30 00:26:31 +02:00
|
|
|
'connections' => [
|
|
|
|
|
|
|
|
'default' => [
|
|
|
|
|
|
|
|
/**
|
2021-03-29 02:15:22 +02:00
|
|
|
* Hosts
|
2016-09-30 00:26:31 +02:00
|
|
|
*
|
|
|
|
* This is an array of hosts that the client will connect to. It can be a
|
2021-03-29 02:15:22 +02:00
|
|
|
* single host, or an array if you are running a cluster of Elasticsearch
|
2016-09-30 00:26:31 +02:00
|
|
|
* instances.
|
|
|
|
*
|
|
|
|
* This is the only configuration value that is mandatory.
|
2016-01-17 14:22:14 +01:00
|
|
|
*
|
2021-03-29 02:15:22 +02:00
|
|
|
* Presently using "extended" host configuration method
|
|
|
|
*
|
|
|
|
* @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/2.0/_configuration.html#_extended_host_configuration
|
|
|
|
*
|
|
|
|
* There is also the shorter "inline" configuration method available
|
2016-09-30 00:26:31 +02:00
|
|
|
*
|
2021-03-29 02:15:22 +02:00
|
|
|
* @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/2.0/_configuration.html#_inline_host_configuration
|
2016-09-30 00:26:31 +02:00
|
|
|
*/
|
2021-03-29 02:15:22 +02:00
|
|
|
|
|
|
|
'hosts' => [
|
|
|
|
[
|
|
|
|
'host' => env('ELASTICSEARCH_HOST', 'localhost'),
|
|
|
|
'port' => env('ELASTICSEARCH_PORT', 9200),
|
|
|
|
'scheme' => env('ELASTICSEARCH_SCHEME', null),
|
|
|
|
'user' => env('ELASTICSEARCH_USER', null),
|
|
|
|
'pass' => env('ELASTICSEARCH_PASS', null),
|
|
|
|
|
|
|
|
// If you are connecting to an Elasticsearch instance on AWS, you will need these values as well
|
|
|
|
'aws' => env('AWS_ELASTICSEARCH_ENABLED', false),
|
|
|
|
'aws_region' => env('AWS_REGION', ''),
|
|
|
|
'aws_key' => env('AWS_ACCESS_KEY_ID', ''),
|
|
|
|
'aws_secret' => env('AWS_SECRET_ACCESS_KEY', ''),
|
|
|
|
'aws_credentials' => null,
|
|
|
|
'aws_session_token' => env('AWS_SESSION_TOKEN', null),
|
|
|
|
],
|
|
|
|
],
|
2016-09-30 00:26:31 +02:00
|
|
|
|
|
|
|
/**
|
2021-03-29 02:15:22 +02:00
|
|
|
* SSL
|
2016-09-30 00:26:31 +02:00
|
|
|
*
|
|
|
|
* If your Elasticsearch instance uses an out-dated or self-signed SSL
|
|
|
|
* certificate, you will need to pass in the certificate bundle. This can
|
|
|
|
* either be the path to the certificate file (for self-signed certs), or a
|
|
|
|
* package like https://github.com/Kdyby/CurlCaBundle. See the documentation
|
|
|
|
* below for all the details.
|
|
|
|
*
|
|
|
|
* If you are using SSL instances, and the certificates are up-to-date and
|
|
|
|
* signed by a public certificate authority, then you can leave this null and
|
|
|
|
* just use "https" in the host path(s) above and you should be fine.
|
|
|
|
*
|
|
|
|
* @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/2.0/_security.html#_ssl_encryption_2
|
|
|
|
*/
|
2021-03-29 02:15:22 +02:00
|
|
|
|
2016-09-30 00:26:31 +02:00
|
|
|
'sslVerification' => null,
|
|
|
|
|
|
|
|
/**
|
2021-03-29 02:15:22 +02:00
|
|
|
* Logging
|
2016-09-30 00:26:31 +02:00
|
|
|
*
|
|
|
|
* Logging is handled by passing in an instance of Monolog\Logger (which
|
|
|
|
* coincidentally is what Laravel's default logger is).
|
|
|
|
*
|
|
|
|
* If logging is enabled, you either need to set the path and log level
|
|
|
|
* (some defaults are given for you below), or you can use a custom logger by
|
|
|
|
* setting 'logObject' to an instance of Psr\Log\LoggerInterface. In fact,
|
|
|
|
* if you just want to use the default Laravel logger, then set 'logObject'
|
|
|
|
* to \Log::getMonolog().
|
|
|
|
*
|
|
|
|
* Note: 'logObject' takes precedent over 'logPath'/'logLevel', so set
|
|
|
|
* 'logObject' null if you just want file-based logging to a custom path.
|
|
|
|
*
|
|
|
|
* @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/2.0/_configuration.html#enabling_logger
|
|
|
|
*/
|
2021-03-29 02:15:22 +02:00
|
|
|
|
2016-09-30 00:26:31 +02:00
|
|
|
'logging' => false,
|
|
|
|
|
|
|
|
// If you have an existing instance of Monolog you can use it here.
|
2021-03-29 02:15:22 +02:00
|
|
|
// 'logObject' => \Log::getMonolog(),
|
2016-09-30 00:26:31 +02:00
|
|
|
|
|
|
|
'logPath' => storage_path('logs/elasticsearch.log'),
|
|
|
|
|
|
|
|
'logLevel' => Monolog\Logger::INFO,
|
|
|
|
|
|
|
|
/**
|
2021-03-29 02:15:22 +02:00
|
|
|
* Retries
|
2016-09-30 00:26:31 +02:00
|
|
|
*
|
|
|
|
* By default, the client will retry n times, where n = number of nodes in
|
|
|
|
* your cluster. If you would like to disable retries, or change the number,
|
|
|
|
* you can do so here.
|
|
|
|
*
|
|
|
|
* @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/2.0/_configuration.html#_set_retries
|
|
|
|
*/
|
2021-03-29 02:15:22 +02:00
|
|
|
|
2016-09-30 00:26:31 +02:00
|
|
|
'retries' => null,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The remainder of the configuration options can almost always be left
|
|
|
|
* as-is unless you have specific reasons to change them. Refer to the
|
|
|
|
* appropriate sections in the Elasticsearch documentation for what each option
|
|
|
|
* does and what values it expects.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2021-03-29 02:15:22 +02:00
|
|
|
* Sniff On Start
|
2016-09-30 00:26:31 +02:00
|
|
|
*
|
|
|
|
* @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/2.0/_configuration.html
|
|
|
|
*/
|
2021-03-29 02:15:22 +02:00
|
|
|
|
2016-09-30 00:26:31 +02:00
|
|
|
'sniffOnStart' => false,
|
|
|
|
|
|
|
|
/**
|
2021-03-29 02:15:22 +02:00
|
|
|
* HTTP Handler
|
2016-09-30 00:26:31 +02:00
|
|
|
*
|
|
|
|
* @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/2.0/_configuration.html#_configure_the_http_handler
|
|
|
|
* @see http://ringphp.readthedocs.org/en/latest/client_handlers.html
|
|
|
|
*/
|
2021-03-29 02:15:22 +02:00
|
|
|
|
2016-09-30 00:26:31 +02:00
|
|
|
'httpHandler' => null,
|
|
|
|
|
|
|
|
/**
|
2021-03-29 02:15:22 +02:00
|
|
|
* Connection Pool
|
2016-09-30 00:26:31 +02:00
|
|
|
*
|
|
|
|
* @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/2.0/_configuration.html#_setting_the_connection_pool
|
|
|
|
* @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/2.0/_connection_pool.html
|
|
|
|
*/
|
2021-03-29 02:15:22 +02:00
|
|
|
|
2016-09-30 00:26:31 +02:00
|
|
|
'connectionPool' => null,
|
|
|
|
|
|
|
|
/**
|
2021-03-29 02:15:22 +02:00
|
|
|
* Connection Selector
|
2016-09-30 00:26:31 +02:00
|
|
|
*
|
|
|
|
* @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/2.0/_configuration.html#_setting_the_connection_selector
|
|
|
|
* @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/2.0/_selectors.html
|
|
|
|
*/
|
2021-03-29 02:15:22 +02:00
|
|
|
|
2016-09-30 00:26:31 +02:00
|
|
|
'connectionSelector' => null,
|
|
|
|
|
|
|
|
/**
|
2021-03-29 02:15:22 +02:00
|
|
|
* Serializer
|
2016-09-30 00:26:31 +02:00
|
|
|
*
|
|
|
|
* @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/2.0/_configuration.html#_setting_the_serializer
|
|
|
|
* @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/2.0/_serializers.html
|
|
|
|
*/
|
2021-03-29 02:15:22 +02:00
|
|
|
|
2016-09-30 00:26:31 +02:00
|
|
|
'serializer' => null,
|
|
|
|
|
|
|
|
/**
|
2021-03-29 02:15:22 +02:00
|
|
|
* Connection Factory
|
2016-09-30 00:26:31 +02:00
|
|
|
*
|
|
|
|
* @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/2.0/_configuration.html#_setting_a_custom_connectionfactory
|
|
|
|
*/
|
2021-03-29 02:15:22 +02:00
|
|
|
|
2016-09-30 00:26:31 +02:00
|
|
|
'connectionFactory' => null,
|
|
|
|
|
|
|
|
/**
|
2021-03-29 02:15:22 +02:00
|
|
|
* Endpoint
|
2016-09-30 00:26:31 +02:00
|
|
|
*
|
2021-03-29 02:15:22 +02:00
|
|
|
* @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/6.0/_configuration.html#_set_the_endpoint_closure
|
2016-09-30 00:26:31 +02:00
|
|
|
*/
|
2021-03-29 02:15:22 +02:00
|
|
|
|
2016-09-30 00:26:31 +02:00
|
|
|
'endpoint' => null,
|
|
|
|
|
2021-03-29 02:15:22 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Register additional namespaces
|
|
|
|
*
|
|
|
|
* An array of additional namespaces to register.
|
|
|
|
*
|
|
|
|
* @example 'namespaces' => [XPack::Security(), XPack::Watcher()]
|
|
|
|
* @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/ElasticsearchPHP_Endpoints.html#Elasticsearch_ClientBuilderregisterNamespace_registerNamespace
|
|
|
|
*/
|
|
|
|
'namespaces' => [],
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Tracer
|
|
|
|
*
|
|
|
|
* Tracer is handled by passing in a name of the class implements Psr\Log\LoggerInterface.
|
|
|
|
*
|
|
|
|
* @see https://www.elastic.co/guide/en/elasticsearch/client/php-api/2.0/_configuration.html#_setting_a_custom_connectionfactory
|
|
|
|
*/
|
|
|
|
'tracer' => null,
|
|
|
|
|
2021-02-14 03:39:15 +01:00
|
|
|
],
|
2021-03-29 02:15:22 +02:00
|
|
|
|
2021-02-14 03:39:15 +01:00
|
|
|
],
|
2016-01-07 19:16:37 +01:00
|
|
|
|
|
|
|
];
|