From 6c60a09e2e0f912790be841a29950bd52d023103 Mon Sep 17 00:00:00 2001 From: Josh Mock Date: Fri, 21 Mar 2025 14:15:13 -0500 Subject: [PATCH] Drop broken support for roles --- docs/basic-config.asciidoc | 12 ++---------- src/client.ts | 7 ------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/docs/basic-config.asciidoc b/docs/basic-config.asciidoc index 799866f93..a77a799ea 100644 --- a/docs/basic-config.asciidoc +++ b/docs/basic-config.asciidoc @@ -167,19 +167,11 @@ const client = new Client({ ---- |`nodeFilter` -a|`function` - Filters which node not to use for a request. + +a|`function` - Takes a `Connection` and returns `true` if it can be sent a request, otherwise `false`. + _Default:_ [source,js] ---- -function defaultNodeFilter (node) { - // avoid master only nodes - if (node.roles.master === true && - node.roles.data === false && - node.roles.ingest === false) { - return false - } - return true -} +() => true ---- |`nodeSelector` diff --git a/src/client.ts b/src/client.ts index aac8af57f..7d97449c0 100644 --- a/src/client.ts +++ b/src/client.ts @@ -78,13 +78,6 @@ export interface NodeOptions { ssl?: TlsConnectionOptions /** @property headers Custom HTTP headers that should be sent with each request */ headers?: Record - /** @property roles Common Elasticsearch roles that can be assigned to this node. Can be helpful when writing custom nodeFilter or nodeSelector functions. */ - roles?: { - master: boolean - data: boolean - ingest: boolean - ml: boolean - } } export interface ClientOptions {