File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ This page contains the information you need to connect and use the Client with
13
13
* <<client-error-handling, Handling errors>>
14
14
* <<keep-alive, Keep-alive connections>>
15
15
* <<product-check, Automatic product check>>
16
+ * <<closing, Closing the client>>
16
17
17
18
[[authentication]]
18
19
[discrete]
@@ -691,6 +692,23 @@ const client = new Client({
691
692
})
692
693
----
693
694
695
+ [discrete]
696
+ [[close-connection]]
697
+ === Close connection
698
+
699
+ If you want to end a connection to an Elasticsearch server, use the `close()` function.
700
+
701
+ [source,js]
702
+ ----
703
+ const client = new Client({
704
+ node: 'http://localhost:9200'
705
+ });
706
+ // ... do various queries
707
+ client.close();
708
+ ----
709
+
710
+
711
+
694
712
[discrete]
695
713
[[product-check]]
696
714
=== Automatic product check
@@ -702,3 +720,4 @@ be sent to the server as part of the request pipeline before the main API call i
702
720
In most cases, this will succeed during the very first API call that the client sends.
703
721
Once the product check completes, no further product check HTTP requests are sent for
704
722
subsequent API calls.
723
+
You can’t perform that action at this time.
0 commit comments