Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions docs/client-concepts/low-level/connecting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
----
Expand All @@ -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);

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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<IApiCallDetails>` that can eaves drop every time a response (good or bad) is created.
You can pass a callback of type `Action<IApiCallDetails>` 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]
Expand Down Expand Up @@ -217,7 +217,7 @@ var list = new List<string>();

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 =>
Expand Down Expand Up @@ -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]
----
Expand All @@ -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<Func<Type, JsonConverter>> ContractConverters => new List<Func<Type, JsonConverter>> <2>
protected override IList<Func<Type, JsonConverter>> ContractConverters => new List<Func<Type, JsonConverter>> <2>
{
t => {
CallToContractConverter++;
Expand Down