Elasticsearch Client Activation in Nodejs

I am using a Nodejs application with npm module-elasticsearch. Should I create an instance of Elasticsearch every time I call the ES API, or should I only create one instance of the ES client and use it for each request, or should I use a combination of the above and what is the difference between them.

+4
source share
1 answer

I create a client for each call (or several calls) because I have to close the client explicitly, because otherwise my node program will not end.

0
source

Source: https://habr.com/ru/post/1542001/


All Articles