NOTE: You are looking at documentation for an older release. For the latest information, see the current release documentation.
ConnectionPool
editConnectionPool
editThis class is responsible for keeping in memory all the Elasticsearch Connection that we are using, there is a single Connection for every node.
Moreover, the connection pool will handle the resurrection strategies and the updates of the pool.
const { Client, ConnectionPool } = require('@elastic/elasticsearch') class MyConnectionPool extends ConnectionPool { markAlive (connection) { // your code super.markAlive(connection) } } const client = new Client({ ConnectionPool: MyConnectionPool })