You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Tests/ClientConcepts/LowLevel/Connecting.doc.cs
+48-36Lines changed: 48 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -10,14 +10,15 @@
10
10
usingNewtonsoft.Json;
11
11
usingTests.Framework;
12
12
usingTests.Framework.MockData;
13
+
usingXunit;
13
14
14
15
namespaceTests.ClientConcepts.LowLevel
15
16
{
16
17
publicclassConnecting
17
18
{
18
-
/** # Connecting
19
+
/** # Connecting
19
20
* Connecting to *Elasticsearch* with `Elasticsearch.Net` is quite easy but has a few toggles and options worth knowing.
20
-
*
21
+
*
21
22
* # Choosing the right connection strategy
22
23
* If you simply new an `ElasticLowLevelClient`, it will be a non-failover connection to `http://localhost:9200`
23
24
*/
@@ -29,9 +30,9 @@ public void InstantiateUsingAllDefaults()
29
30
30
31
}
31
32
/**
32
-
* If your Elasticsearch node does not live at `http://localhost:9200` but i.e `http://mynode.example.com:8082/apiKey`, then
33
+
* If your Elasticsearch node does not live at `http://localhost:9200` but i.e `http://mynode.example.com:8082/apiKey`, then
33
34
* you will need to pass in some instance of `IConnectionConfigurationValues`.
34
-
*
35
+
*
35
36
* The easiest way to do this is:
36
37
*/
37
38
@@ -42,9 +43,9 @@ public void InstantiatingASingleNodeClient()
42
43
varclient=newElasticLowLevelClient(config);
43
44
}
44
45
45
-
/**
46
+
/**
46
47
* This however is still a non-failover connection. Meaning if that `node` goes down the operation will not be retried on any other nodes in the cluster.
47
-
*
48
+
*
48
49
* To get a failover connection we have to pass an `IConnectionPool` instance instead of a `Uri`.
49
50
*/
50
51
@@ -56,12 +57,12 @@ public void InstantiatingAConnectionPoolClient()
56
57
varclient=newElasticLowLevelClient(config);
57
58
}
58
59
59
-
/**
60
+
/**
60
61
* Here instead of directly passing `node`, we pass a `SniffingConnectionPool` which will use our `node` to find out the rest of the available cluster nodes.
61
62
* Be sure to read more about [Connection Pooling and Cluster Failover here](/elasticsearch-net/cluster-failover.html)
62
-
*
63
+
*
63
64
* ## Options
64
-
*
65
+
*
65
66
* Besides either passing a `Uri` or `IConnectionPool` to `ConnectionConfiguration`, you can also fluently control many more options. For instance:
66
67
*/
67
68
@@ -95,22 +96,22 @@ public void AvailableOptions()
95
96
96
97
.EnableHttpCompression()
97
98
/**
98
-
* Enable compressed request and reesponses from Elasticsearch (Note that nodes need to be configured
99
+
* Enable compressed request and reesponses from Elasticsearch (Note that nodes need to be configured
99
100
* to allow this. See the [http module settings](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-http.html) for more info).
100
101
*/
101
102
102
103
.DisableDirectStreaming()
103
104
/**
104
105
* By default responses are deserialized off stream to the object you tell it to.
105
-
* For debugging purposes it can be very useful to keep a copy of the raw response on the result object.
106
+
* For debugging purposes it can be very useful to keep a copy of the raw response on the result object.
* class and setting the [ServerCertificateValidationCallback](http://msdn.microsoft.com/en-us/library/system.net.servicepointmanager.servercertificatevalidationcallback.aspx)
270
282
* property.
271
-
*
283
+
*
272
284
* 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`:
0 commit comments