本文整理匯總了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;
}
示例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;
}
示例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);
}