public static ElasticClient Create(IEnumerable<string> addresses)
 {
     var uris = addresses.Select(address => new Uri(address));
     var connectionPool = new StaticConnectionPool(uris);
     var settings = new ConnectionSettings(connectionPool);
     settings.MaximumRetries(3);
     settings.SetPingTimeout(500);
     return new ElasticClient(settings);
 }
        /// <summary>
        /// Get the bulk connection pool of hosts
        /// </summary>
        /// <returns></returns>
        private ElasticClient getClient()
        {
            var nodes = new List<Uri>();
            foreach (var host in _hosts)
            {
                var uri = ComposeUri(host, _port, _ssl, _username, _password);
                nodes.Add(uri);
            }
            var pool = new StaticConnectionPool(nodes.ToArray());
            var settings = new ConnectionSettings(pool)
                .ExposeRawResponse();

            if (_disablePing)
                settings.DisablePing();
            else if (_pingTimeout != 0)
                settings.SetPingTimeout(_pingTimeout);

            var client = new ElasticClient(settings);
            return client;
        }
        /// <summary>
        /// Get the bulk connection pool of hosts
        /// </summary>
        /// <returns></returns>
        private ElasticClient getClient()
        {
            var nodes = new List<Uri>();
            foreach (var host in _hosts)
            {
                var url = string.Format("http://{0}:{1}", host, _port);
                nodes.Add(new Uri(url));
            }
            var pool = new StaticConnectionPool(nodes.ToArray());
            var settings = new ConnectionSettings(pool)
                .ExposeRawResponse();

            if (_disablePing)
                settings.DisablePing();
            else if (_pingTimeout != 0)
                settings.SetPingTimeout(_pingTimeout);

            var client = new ElasticClient(settings);
            return client;
        }