1 | <?php |
||
9 | class Factory |
||
10 | { |
||
11 | |||
12 | /** |
||
13 | * Map configuration array keys with ES ClientBuilder setters |
||
14 | * |
||
15 | * @var array |
||
16 | */ |
||
17 | protected $configMappings = [ |
||
18 | 'sslVerification' => 'setSSLVerification', |
||
19 | 'sniffOnStart' => 'setSnifefOnStart', |
||
20 | 'retries' => 'setRetries', |
||
21 | 'httpHandler' => 'setHandler', |
||
22 | 'connectionPool' => 'setConnectionPool', |
||
23 | 'connectionSelector' => 'setSelector', |
||
24 | 'serializer' => 'setSerializer', |
||
25 | 'connectionFactory' => 'setConnectionFactory', |
||
26 | 'endpoint' => 'setEndpoint', |
||
27 | ]; |
||
28 | |||
29 | /** |
||
30 | * Make the Elasticsearch client for the given named configuration, or |
||
31 | * the default client. |
||
32 | * |
||
33 | * @param array $config |
||
34 | * @return \Elasticsearch\Client|mixed |
||
35 | */ |
||
36 | public function make(array $config) |
||
42 | |||
43 | /** |
||
44 | * Build and configure an Elasticsearch client. |
||
45 | * |
||
46 | * @param array $config |
||
47 | * @return \Elasticsearch\Client |
||
48 | */ |
||
49 | protected function buildClient(array $config) |
||
85 | } |
||
86 |