public ElasticClientFactory(string uri, string defaultIndex, string username, string password) { var uriuri = new Uri(uri); var settings = new ConnectionSettings(uriuri, defaultIndex); var connection = new BasicallyAuthenticatedHttpConnection(username, password, new ConnectionConfiguration(uriuri)); this.CreateClient(settings, connection, null, null); }