npm / @elastic/elasticsearch
@elastic/elasticsearch
What changed in @elastic/elasticsearch 8 to 9, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
23 breaking1 deprecations10 new APIs and options1 performance4 behavior and defaults15 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@elastic/elasticsearch 927 changes
Breaking changes 1
The minimum supported Node.js version is now 20; Node.js 18 reached end-of-life in April 2025.
Deprecations 1
Marked deprecated since Elasticsearch 9.5 because Lucene 10.4 computes it automatically.
New APIs and options 10
Specification types now include the columnar_stored source field mode.
Adds the missing auto_calibrate property for bbq_disk index options.
Adds the missing bits property for bbq_disk index options.
Adds the missing cluster_size property for bbq_disk index options.
Adds the missing precondition property for bbq_disk index options.
Adds a client option to reject requests before sending them when the path and query string exceed a configurable byte length.
Accepts an onFlush callback called each time the bulk buffer is flushed, receiving the same stats object as onDrop.
Changes and additions to Elasticsearch APIs for 9.3 are reflected in the client.
The client supports importing directly from the elasticsearch package without a bundler like Webpack or Rollup.
Transport request metadata now includes the names of all parameters an API supports, helping custom transports make more flexible pre-flight request modifications.
Behavior and default changes 1
The package is an optional peer dependency and is only needed when using the ES|QL helpers that require it, reducing the dependency tree for other users.
Fixes and other changes 14
Adds the missing default_visit_percentage property for bbq_disk index options.
The normalizer field is now optional, so TypeScript accepts valid requests that omit it.
The weight field is now optional, so TypeScript accepts valid requests that omit it.
The num_candidates field is now optional, matching the server default introduced in Elasticsearch 9.5.
Changes and additions to Elasticsearch APIs for 9.5 are reflected in the client.
The bulk API only throws an error when operations is truly empty.
The bulk helper now throws errors properly when given a stream.
Changes and additions to Elasticsearch 9.4 APIs are reflected in the client release.
Server error responses are surfaced as a ResponseError instead of passing the raw error stream to Apache Arrow, avoiding a confusing parse failure.
acceptedParams now categorizes parameters as path, body, and query so consumers can determine where to inject parameters like project_routing.
Corrections and improvements to the Elasticsearch specification improve compatibility with Elasticsearch 9.3.
Exported estypes for ESM-based projects and fixed ESM module compatibility with JavaScript bundlers.
Child clients with different auth options no longer share the authorization header from the first child.
Changes and additions to Elasticsearch APIs for its 9.2 release are reflected in this release.
@elastic/elasticsearch 827 changes
Breaking changes 22
Requests can be aborted using the standard AbortController API and a request signal.
API calls return the response body instead of HTTP-related keys by default.
Request parameters are no longer wrapped in a body key; pass them directly in the request object.
The callback-style API is dropped in favor of the full-promise API.
Camel-cased path and query parameter keys are no longer supported; use snake_case keys.
The client extensions API is removed; use transport.request if necessary.
Cloud configuration no longer accepts password; configure basic authentication in auth instead.
Cloud configuration no longer accepts username; configure basic authentication in auth instead.
The client exposes a diagnostic property that is a proper event emitter, replacing the emitter-like methods on the client.
The policy parameter is renamed to name.
The policy parameter is renamed to name.
The policy parameter is renamed to name.
Set the request-specific meta option to receive full response details, including the body, status code, headers, and warnings.
Prototype poisoning protection is removed because it can cause performance issues with big payloads; the notes say documentation will show how to add it back with a custom serializer.
Snake-cased client methods are no longer supported; use camelCased methods instead.
The repository parameter is renamed to name.
The repository parameter is renamed to name.
The repository parameter is renamed to name.
The repository parameter is renamed to name.
The repository parameter is renamed to name.
The ssl option is renamed to tls in client configuration.
The client ships new TypeScript definitions with request and response definitions; the current definitions are removed.
Performance 1
The client moves to a weight-based connection pool for better performance and less background code; the old pool can still be used.
Behavior and default changes 3
The default timeout is increased to 10 minutes to help avoid premature disconnection of slow requests.
After client.close is called, new requests are rejected with NoLivingConnectionsError; in-flight requests run normally unless they require a retry.
Undici replaces the default Node.js HTTP client; the old HTTP client can still be used.
Fixes and other changes 1
Fixes invalid URL errors for nodes configured with a URL path prefix.