WARNING: Version 5.x has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. 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 })