/// <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; }