- JavaScript Client: other versions:
- Introduction
- Usage
- Client configuration
- API Reference
- Common parameters
- bulk
- cat.aliases
- cat.allocation
- cat.count
- cat.fielddata
- cat.health
- cat.help
- cat.indices
- cat.master
- cat.nodeattrs
- cat.nodes
- cat.pendingTasks
- cat.plugins
- cat.recovery
- cat.repositories
- cat.segments
- cat.shards
- cat.snapshots
- cat.tasks
- cat.templates
- cat.threadPool
- clearScroll
- cluster.allocationExplain
- cluster.getSettings
- cluster.health
- cluster.pendingTasks
- cluster.putSettings
- cluster.remoteInfo
- cluster.reroute
- cluster.state
- cluster.stats
- count
- countPercolate
- create
- delete
- deleteByQuery
- deleteScript
- deleteTemplate
- exists
- existsSource
- explain
- fieldCaps
- fieldStats
- get
- getScript
- getSource
- getTemplate
- index
- indices.analyze
- indices.clearCache
- indices.close
- indices.create
- indices.delete
- indices.deleteAlias
- indices.deleteTemplate
- indices.exists
- indices.existsAlias
- indices.existsTemplate
- indices.existsType
- indices.flush
- indices.flushSynced
- indices.forcemerge
- indices.get
- indices.getAlias
- indices.getFieldMapping
- indices.getMapping
- indices.getSettings
- indices.getTemplate
- indices.getUpgrade
- indices.open
- indices.putAlias
- indices.putMapping
- indices.putSettings
- indices.putTemplate
- indices.recovery
- indices.refresh
- indices.rollover
- indices.segments
- indices.shardStores
- indices.shrink
- indices.stats
- indices.updateAliases
- indices.upgrade
- indices.validateQuery
- info
- ingest.deletePipeline
- ingest.getPipeline
- ingest.processorGrok
- ingest.putPipeline
- ingest.simulate
- mget
- mpercolate
- msearch
- msearchTemplate
- mtermvectors
- nodes.hotThreads
- nodes.info
- nodes.stats
- percolate
- ping
- putScript
- putTemplate
- reindex
- reindexRethrottle
- renderSearchTemplate
- scroll
- search
- searchShards
- searchTemplate
- snapshot.create
- snapshot.createRepository
- snapshot.delete
- snapshot.deleteRepository
- snapshot.get
- snapshot.getRepository
- snapshot.restore
- snapshot.status
- snapshot.verifyRepository
- suggest
- tasks.cancel
- tasks.get
- tasks.list
- termvectors
- update
- updateByQuery
- Breaking changes coming from the old client
- Authentication
- Observability
- Creating a child client
- Extend the client
- TypeScript support
- Examples
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 })
Was this helpful?
Thank you for your feedback.