diff --git a/docs/connecting.asciidoc b/docs/connecting.asciidoc index 77c2e7d11..85a9154a5 100644 --- a/docs/connecting.asciidoc +++ b/docs/connecting.asciidoc @@ -12,6 +12,7 @@ This page contains the information you need to connect and use the Client with * <> * <> * <> +* <> * <> [[authentication]] @@ -691,6 +692,23 @@ const client = new Client({ }) ---- + +[[closing]] +[discrete] +=== Closing the client + +If you want to end a connection to an Elasticsearch server, use the `close()` function. + +[source,js] +---- +const client = new Client({ + node: 'http://localhost:9200' +}); +// ... do various queries +client.close(); +---- + + [discrete] [[product-check]] === Automatic product check @@ -702,3 +720,4 @@ be sent to the server as part of the request pipeline before the main API call i In most cases, this will succeed during the very first API call that the client sends. Once the product check completes, no further product check HTTP requests are sent for subsequent API calls. +