private string CreatePathWithQueryStrings(string path, IConnectionConfigurationValues global, IRequestParameters request = null) { //Make sure we append global query string as well the request specific query string parameters var copy = new NameValueCollection(global.QueryStringParameters); var formatter = new UrlFormatProvider(this.ConnectionSettings); if (request != null) { copy.Add(request.QueryString.ToNameValueCollection(formatter)); } if (!copy.HasKeys()) { return(path); } var queryString = copy.ToQueryString(); var tempUri = new Uri("http://localhost:9200/" + path).Purify(); if (tempUri.Query.IsNullOrEmpty()) { path += queryString; } else { path += "&" + queryString.Substring(1, queryString.Length - 1); } return(path); }
/// <summary> /// Instantiate a new low level elasticsearch client explicitly specifying a custom transport setup /// </summary> public ElasticLowLevelClient(ITransport <IConnectionConfigurationValues> transport) { transport.ThrowIfNull(nameof(transport)); transport.Settings.ThrowIfNull(nameof(transport.Settings)); transport.Settings.RequestResponseSerializer.ThrowIfNull(nameof(transport.Settings.RequestResponseSerializer)); this.Transport = transport; this._formatter = new UrlFormatProvider(this.Transport.Settings); }
private string CreatePathWithQueryStrings(string path, IConnectionConfigurationValues global, IRequestParameters request = null) { //Make sure we append global query string as well the request specific query string parameters var copy = new NameValueCollection(global.QueryStringParameters); var formatter = new UrlFormatProvider(this.ConnectionSettings); if (request != null) { copy.Add(request.QueryString.ToNameValueCollection(formatter)); } if (!copy.HasKeys()) { return(path); } var queryString = copy.ToQueryString(); path += queryString; return(path); }
private string CreatePathWithQueryStrings(string path, IConnectionConfigurationValues global, IRequestParameters request = null) { //Make sure we append global query string as well the request specific query string parameters var copy = new NameValueCollection(global.QueryStringParameters); var formatter = new UrlFormatProvider(this.ConnectionSettings); if (request != null) copy.Add(request.QueryString.ToNameValueCollection(formatter)); if (!copy.HasKeys()) return path; var queryString = copy.ToQueryString(); var tempUri = new Uri("http://localhost:9200/" + path).Purify(); if (tempUri.Query.IsNullOrEmpty()) path += queryString; else path += "&" + queryString.Substring(1, queryString.Length - 1); return path; }
private string CreatePathWithQueryStrings(string path, IConnectionConfigurationValues global, IRequestParameters request = null) { //Make sure we append global query string as well the request specific query string parameters var copy = new NameValueCollection(global.QueryStringParameters); var formatter = new UrlFormatProvider(this.ConnectionSettings); if (request != null) copy.Add(request.QueryString.ToNameValueCollection(formatter)); if (!copy.HasKeys()) return path; var queryString = copy.ToQueryString(); path += queryString; return path; }