private function buildClient(array $config)
    {
        $client = ClientBuilder::create()
            ->setHosts($config['hosts']);

        if (isset($config['retries'])) {
            $client->setRetries($config['retries']);
        }

        if (isset($config['logging']) and $config['logging']['enabled'] == true) {
            $logger = ClientBuilder::defaultLogger($config['logging']['path'], $config['logging']['level']);
            $client->setLogger($logger);
        }

        return $client->build();
    }
private function buildClient(array $config)
    {
        $client = ClientBuilder::create()
            ->setHosts($config['hosts']);

        if (isset($config['retries'])) {
            $client->setRetries($config['retries']);
        }

        if (isset($config['logging']) and $config['logging']['enabled'] == true) {
            $logger = ClientBuilder::defaultLogger($config['logging']['path'], $config['logging']['level']);
            $client->setLogger($logger);
        }

        return $client->build();
    }
private function buildClient ( array $ config ) { $ client = ClientBuilder :: create ( ) -> setHosts ( $ config [ 'hosts' ] ) ; if ( isset ( $ config [ 'retries' ] ) ) { $ client -> setRetries ( $ config [ 'retries' ] ) ; } if ( isset ( $ config [ 'logging' ] ) and $ config [ 'logging' ] [ 'enabled' ] == true ) { $ logger = ClientBuilder :: defaultLogger ( $ config [ 'logging' ] [ 'path' ] , $ config [ 'logging' ] [ 'level' ] ) ; $ client -> setLogger ( $ logger ) ; } return $ client -> build ( ) ; }
Create an elastic search instance.

@param array $config

@return Client
Create an elastic search instance .