(cherry picked from commit e502d2f17a)
Co-authored-by: Josh Mock <joshua.mock@elastic.co>
This commit is contained in:
committed by
GitHub
parent
177a420521
commit
75f31d974d
@ -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`
|
||||
|
||||
@ -78,13 +78,6 @@ export interface NodeOptions {
|
||||
ssl?: TlsConnectionOptions
|
||||
/** @property headers Custom HTTP headers that should be sent with each request */
|
||||
headers?: Record<string, any>
|
||||
/** @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 {
|
||||
|
||||
Reference in New Issue
Block a user