From 96c1242c73678cffa2434baa96b115aa48c2660b Mon Sep 17 00:00:00 2001 From: ericamick Date: Tue, 17 May 2016 09:54:00 -0400 Subject: [PATCH] Update connecting.asciidoc --- .../low-level/connecting.asciidoc | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/docs/client-concepts/low-level/connecting.asciidoc b/docs/client-concepts/low-level/connecting.asciidoc index 820ce87521c..c6aa745088d 100644 --- a/docs/client-concepts/low-level/connecting.asciidoc +++ b/docs/client-concepts/low-level/connecting.asciidoc @@ -63,7 +63,7 @@ var node = new Uri("http://mynode.example.com:8082/apiKey"); var connectionPool = new SniffingConnectionPool(new[] { node }); var config = new ConnectionConfiguration(connectionPool) - .DisableDirectStreaming() <1> + .DisableDirectStreaming() <1> .BasicAuthentication("user", "pass") .RequestTimeout(TimeSpan.FromSeconds(5)); ---- @@ -74,9 +74,9 @@ The following is a list of available connection configuration options: [source,csharp] ---- var config = new ConnectionConfiguration() - .DisableAutomaticProxyDetection() <1> - .EnableHttpCompression() <2> - .DisableDirectStreaming(); <3> + .DisableAutomaticProxyDetection() <1> + .EnableHttpCompression() <2> + .DisableDirectStreaming(); <3> var client = new ElasticLowLevelClient(config); @@ -115,11 +115,11 @@ other configuration options [source,csharp] ---- config = config - .GlobalQueryStringParameters(new NameValueCollection()) <1> - .Proxy(new Uri("http://myproxy"), "username", "pass") <2> - .RequestTimeout(TimeSpan.FromSeconds(4)) <3> - .ThrowExceptions() <4> - .PrettyJson() <5> + .GlobalQueryStringParameters(new NameValueCollection()) <1> + .Proxy(new Uri("http://myproxy"), "username", "pass") <2> + .RequestTimeout(TimeSpan.FromSeconds(4)) <3> + .ThrowExceptions() <4> + .PrettyJson() <5> .BasicAuthentication("username", "password"); ---- <1> Allows you to set querystring parameters that have to be added to every request. For instance, if you use a hosted elasticserch provider, and you need need to pass an `apiKey` parameter onto every request. @@ -167,7 +167,7 @@ These should not be handled as you want to know about them during development. === OnRequestCompleted -You can pass a callback of type `Action` that can eaves drop every time a response (good or bad) is created. +You can pass a callback of type `Action` that can eavesdrop every time a response (good or bad) is created. If you have complex logging needs this is a good place to add that in. [source,csharp] @@ -217,7 +217,7 @@ var list = new List(); var connectionPool = new SingleNodeConnectionPool(new Uri("http://localhost:9200")); -var settings = new ConnectionSettings(connectionPool, new InMemoryConnection()) <1> +var settings = new ConnectionSettings(connectionPool, new InMemoryConnection()) <1> .DefaultIndex("default-index") .DisableDirectStreaming() .OnRequestCompleted(response => @@ -285,11 +285,12 @@ list.ShouldAllBeEquivalentTo(new [] [[configuring-ssl]] === Configuring SSL -SSL must be configured outside of the client using .NET's http://msdn.microsoft.com/en-us/library/system.net.servicepointmanager%28v=vs.110%29.aspx[ServicePointManager] +SSL must be configured outside of the client using .NET's + http://msdn.microsoft.com/en-us/library/system.net.servicepointmanager%28v=vs.110%29.aspx[ServicePointManager] class and setting the http://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.servercertificatevalidationcallback.aspx[ServerCertificateValidationCallback] property. -The bare minimum to make .NET accept self-signed SSL certs that are not in the Window's CA store would be to have the callback simply return `true`: +The bare minimum to make .NET accept self-signed SSL certs that are not in the Windows CA store would be to have the callback simply return `true`: [source,csharp] ---- @@ -314,11 +315,11 @@ public class MyJsonNetSerializer : JsonNetSerializer public int CallToModify { get; set; } = 0; - protected override void ModifyJsonSerializerSettings(JsonSerializerSettings settings) => ++CallToModify; <1> + protected override void ModifyJsonSerializerSettings(JsonSerializerSettings settings) => ++CallToModify; <1> public int CallToContractConverter { get; set; } = 0; - protected override IList> ContractConverters => new List> <2> + protected override IList> ContractConverters => new List> <2> { t => { CallToContractConverter++;