當前位置: 首頁>>代碼示例>>C#>>正文


C# ConnectionSettings.SetTimeout方法代碼示例

本文整理匯總了C#中Nest.ConnectionSettings.SetTimeout方法的典型用法代碼示例。如果您正苦於以下問題:C# ConnectionSettings.SetTimeout方法的具體用法?C# ConnectionSettings.SetTimeout怎麽用?C# ConnectionSettings.SetTimeout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Nest.ConnectionSettings的用法示例。


在下文中一共展示了ConnectionSettings.SetTimeout方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetElasticClient

 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;
 }
開發者ID:rsteasdale,項目名稱:LateSeats.Web,代碼行數:8,代碼來源:ElasticClientWrapper.cs

示例2: GetElasticClient

 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;
 }
開發者ID:rsteasdale,項目名稱:LateSeats.Web,代碼行數:8,代碼來源:ElasticConfiguration.cs

示例3: DataMartController

 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);
 }
開發者ID:dynamicdeploy,項目名稱:ElasticSearchWebAPIWrapper,代碼行數:9,代碼來源:DataMartController.cs


注:本文中的Nest.ConnectionSettings.SetTimeout方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。