Skip to content

Commit 75f31d9

Browse files
Drop broken support for roles (#2674) (#2675)
(cherry picked from commit e502d2f) Co-authored-by: Josh Mock <[email protected]>
1 parent 177a420 commit 75f31d9

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

docs/basic-config.asciidoc

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,11 @@ const client = new Client({
167167
----
168168

169169
|`nodeFilter`
170-
a|`function` - Filters which node not to use for a request. +
170+
a|`function` - Takes a `Connection` and returns `true` if it can be sent a request, otherwise `false`. +
171171
_Default:_
172172
[source,js]
173173
----
174-
function defaultNodeFilter (node) {
175-
// avoid master only nodes
176-
if (node.roles.master === true &&
177-
node.roles.data === false &&
178-
node.roles.ingest === false) {
179-
return false
180-
}
181-
return true
182-
}
174+
() => true
183175
----
184176

185177
|`nodeSelector`

src/client.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,6 @@ export interface NodeOptions {
7878
ssl?: TlsConnectionOptions
7979
/** @property headers Custom HTTP headers that should be sent with each request */
8080
headers?: Record<string, any>
81-
/** @property roles Common Elasticsearch roles that can be assigned to this node. Can be helpful when writing custom nodeFilter or nodeSelector functions. */
82-
roles?: {
83-
master: boolean
84-
data: boolean
85-
ingest: boolean
86-
ml: boolean
87-
}
8881
}
8982

9083
export interface ClientOptions {

0 commit comments

Comments
 (0)