protected function getConfig($name)
{
$connections = $this->app['config']['elasticsearch.connections'];
if (is_null($config = array_get($connections, $name))) {
throw new \InvalidArgumentException("Elasticsearch connection [{$name}] not configured.");
}
return $config;
}