@@ -34,7 +34,7 @@ public string DefaultIndex
3434 public FluentDictionary < Type , string > DefaultTypeNames { get ; private set ; }
3535 public NameValueCollection QueryStringParameters { get ; private set ; }
3636
37- public ConnectionSettings ( Uri uri , NameValueCollection queryStringParamaters )
37+ public ConnectionSettings ( Uri uri )
3838 {
3939 uri . ThrowIfNull ( "uri" ) ;
4040
@@ -51,11 +51,8 @@ public ConnectionSettings(Uri uri, NameValueCollection queryStringParamaters)
5151 this . DefaultIndices = new FluentDictionary < Type , string > ( ) ;
5252 this . DefaultTypeNames = new FluentDictionary < Type , string > ( ) ;
5353 this . ConnectionStatusHandler = this . ConnectionStatusDefaultHandler ;
54- this . QueryStringParameters = queryStringParamaters ;
5554 }
5655
57- public ConnectionSettings ( Uri uri ) : this ( uri , null ) { }
58-
5956 /// <summary>
6057 /// Enable Trace signals to the IConnection that it should put debug information on the Trace.
6158 /// </summary>
@@ -65,6 +62,19 @@ public ConnectionSettings EnableTrace(bool enabled = true)
6562 return this ;
6663 }
6764
65+
66+ /// <summary>
67+ /// This NameValueCollection will be appended to every url NEST calls, great if you need to pass i.e an API key.
68+ /// </summary>
69+ /// <param name="queryStringParameters"></param>
70+ /// <returns></returns>
71+ public ConnectionSettings SetGlobalQueryStringParameters ( NameValueCollection queryStringParameters )
72+ {
73+ this . QueryStringParameters = queryStringParameters ;
74+ return this ;
75+ }
76+
77+
6878 /// <summary>
6979 /// Timeout in milliseconds when the .NET webrquest should abort the request, note that you can set this to a high value here,
7080 /// and specify the timeout in various calls on Elasticsearch's side.
@@ -113,17 +123,6 @@ public ConnectionSettings SetProxy(Uri proxyAdress, string username, string pass
113123 return this ;
114124 }
115125
116- /// <summary>
117- /// Timeout in milliseconds when the .NET webrquest should abort the request, note that you can set this to a high value here,
118- /// and specify the timeout in various calls on Elasticsearch's side.
119- /// </summary>
120- /// <param name="timeout">time out in milliseconds</param>
121- public ConnectionSettings SetTimeout ( int timeout )
122- {
123- this . Timeout = timeout ;
124- return this ;
125- }
126-
127126 /// <summary>
128127 /// Append ?pretty=true to requests, this helps to debug send and received json.
129128 /// </summary>
0 commit comments