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: docs/reference/_options_on_elasticsearchclientsettings.md
+2-11Lines changed: 2 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,6 @@ The following is a list of available connection configuration options on `Elasti
20
20
`Base64ApiKey` for Elastic Cloud style encoded api keys
21
21
```
22
22
23
-
24
23
`ClientCertificate`
25
24
: Use the following certificates to authenticate all HTTP requests. You can also set them on individual request using `ClientCertificates`.
26
25
@@ -34,7 +33,6 @@ The following is a list of available connection configuration options on `Elasti
34
33
35
34
For Core CLR, this setting applies to the `MaxConnectionsPerServer` property on the `HttpClientHandler` instances used by the `HttpClient` inside the default `IConnection` implementation.
36
35
37
-
38
36
`DeadTimeout`
39
37
: The time to put dead nodes out of rotation (this will be multiplied by the number of times they’ve been dead).
40
38
@@ -43,13 +41,11 @@ The following is a list of available connection configuration options on `Elasti
43
41
44
42
The client by default will use the value of a property named `Id` on a CLR type as the `_id` to send to {{es}}. Adding a type will disable this behaviour for that CLR type. If `Id` inference should be disabled for all CLR types, use `DefaultDisableIdInference`.
45
43
46
-
47
44
`DefaultFieldNameInferrer`
48
45
: Specifies how field names are inferred from CLR property names.
49
46
50
47
By default, the client camel cases property names. For example, CLR property `EmailAddress` will be inferred as "emailAddress" {{es}} document field name.
51
48
52
-
53
49
`DefaultIndex`
54
50
: The default index to use for a request when no index has been explicitly specified and no default indices are specified for the given CLR type specified for the request.
55
51
@@ -82,7 +78,6 @@ The following is a list of available connection configuration options on `Elasti
82
78
83
79
For Desktop CLR, sets `ServicePointManager`.`SetTcpKeepAlive`.
84
80
85
-
86
81
`EnableTcpStats`
87
82
: Enable statistics about TCP connections to be collected when making a request.
88
83
@@ -110,8 +105,8 @@ The following is a list of available connection configuration options on `Elasti
110
105
`OnRequestCompleted`
111
106
: Allows you to register a callback every time a an API call is returned.
112
107
113
-
`OnRequestDataCreated`
114
-
: An action to run when the `RequestData` for a request has been created.
108
+
`OnBeforeRequest`
109
+
: An action to run before a request is made.
115
110
116
111
`PingTimeout`
117
112
: The timeout in milliseconds to use for ping requests, which are issued to determine whether a node is alive.
@@ -121,7 +116,6 @@ The following is a list of available connection configuration options on `Elasti
121
116
122
117
Note: this is not a guarantee you will always get prettified json.
123
118
124
-
125
119
`Proxy`
126
120
: If your connection has to go through proxy, use this method to specify the proxy url.
127
121
@@ -148,7 +142,6 @@ The following is a list of available connection configuration options on `Elasti
148
142
149
143
Reasons for such exceptions could be search parser errors, index missing exceptions, and so on.
150
144
151
-
152
145
`TransferEncodingChunked`
153
146
: Whether the request should be sent with chunked Transfer-Encoding.
154
147
@@ -171,5 +164,3 @@ var settings= new ElasticsearchClientSettings()
Copy file name to clipboardExpand all lines: docs/reference/configuration.md
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,5 +6,3 @@ mapped_pages:
6
6
# Configuration [configuration]
7
7
8
8
Connecting to {{es}} with the client is easy, but it’s possible that you’d like to change the default connection behaviour. There are a number of configuration options available on `ElasticsearchClientSettings` that can be used to control how the client interact with {{es}}.
Copy file name to clipboardExpand all lines: docs/reference/connecting.md
+5-9Lines changed: 5 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,10 +10,10 @@ This page contains the information you need to create an instance of the .NET Cl
10
10
It’s possible to connect to your {{es}} cluster via a single node, or by specifying multiple nodes using a node pool. Using a node pool has a few advantages over a single node, such as load balancing and cluster failover support. The client provides convenient configuration options to connect to an Elastic Cloud deployment.
11
11
12
12
::::{important}
13
-
Client applications should create a single instance of `ElasticsearchClient` that is used throughout your application for its entire lifetime. Internally the client manages and maintains HTTP connections to nodes, reusing them to optimize performance. If you use a dependency injection container for your application, the client instance should be registered with a singleton lifetime.
14
-
::::
15
13
14
+
Client applications should create a single instance of `ElasticsearchClient` that is used throughout your application for its entire lifetime. Internally the client manages and maintains HTTP connections to nodes, reusing them to optimize performance. If you use a dependency injection container for your application, the client instance should be registered with a singleton lifetime.
16
15
16
+
::::
17
17
18
18
## Connecting to a cloud deployment [cloud-deployment]
19
19
@@ -36,8 +36,6 @@ var client = new ElasticsearchClient("<CLOUD_ID>", new ApiKey("<API_KEY>")); <1>
36
36
37
37
1. Replace the placeholder string values above with your cloud ID and the API key configured for your application to access your deployment.
38
38
39
-
40
-
41
39
## Connecting to a single node [single-node]
42
40
43
41
Single node configuration is best suited to connections to a multi-node cluster running behind a load balancer or reverse proxy, which is exposed via a single URL. It may also be convenient to use a single node during local application development. If the URL represents a single {{es}} node, be aware that this offers no resiliency should the server be unreachable or unresponsive.
@@ -92,7 +90,6 @@ var client = new ElasticsearchClient(settings);
92
90
93
91
The preceding snippet demonstrates configuring the client to authenticate by providing a username and password with basic authentication. If preferred, you may also use `ApiKey` authentication as shown in the cloud connection example.
94
92
95
-
96
93
## Connecting to multiple nodes using a node pool [multiple-nodes]
97
94
98
95
To provide resiliency, you should configure multiple nodes for your cluster to which the client attempts to communicate. By default, the client cycles through nodes for each request in a round robin fashion. The client also tracks unhealthy nodes and avoids sending requests to them until they become healthy.
@@ -107,9 +104,9 @@ using Elastic.Transport;
107
104
108
105
varnodes=newUri[]
109
106
{
110
-
newUri("https://myserver1:9200"),
111
-
newUri("https://myserver2:9200"),
112
-
newUri("https://myserver3:9200")
107
+
newUri("https://myserver1:9200"),
108
+
newUri("https://myserver2:9200"),
109
+
newUri("https://myserver3:9200")
113
110
};
114
111
115
112
varpool=newStaticNodePool(nodes);
@@ -120,4 +117,3 @@ var settings = new ElasticsearchClientSettings(pool)
0 commit comments