public ElasticClient GetElasticClient() { var node = new Uri(_configWrapper.Get("ESUrl")); var config = new ConnectionSettings(node, "lateseats"); config.SetTimeout(Convert.ToInt32(_configWrapper.Get("ESTimeout"))); var client = new ElasticClient(config); return client; }
public ElasticClient GetElasticClient(string uri) { var node = new Uri(uri); var config = new ConnectionSettings(node, "lateseats"); config.SetTimeout(Convert.ToInt32(ConfigurationManager.AppSettings["ESTimeout"])); var client = new ElasticClient(config); return client; }
public DataMartController() { Uri esServer = new Uri(ConfigurationManager.AppSettings["ElasticSearchServerUrl"]); int timeout; Int32.TryParse(ConfigurationManager.AppSettings["ESConnectionTimeoutInMinutes"], out timeout); myConnection = new ConnectionSettings(esServer); myConnection.SetTimeout(1000 * 60 * timeout); // connection timeout esClient = new ElasticClient(myConnection); }