pypi / elasticsearch
elasticsearch
What changed in elasticsearch 8 to 9, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-05.
56 breaking1 security14 deprecations184 new APIs and options3 behavior and defaults1 tooling10 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initelasticsearch 9202 changes
Breaking changes 24
Removes the master_timeout parameter from the searchable_snapshots.cache_stats API.
Removes the chunking_settings argument from inference.put_anthropic.
Removes the chunking_settings argument from inference.put_contextualai.
Removes the chunking_settings argument from inference.put_deepseek.
Python 3.9 is no longer supported.
Removes the unsupported size parameter from reindex.
Removes the visit_percentage argument from the Knn query class.
Removes the index_options argument from the SemanticText field class.
The Async Search Submit API no longer accepts min_compatible_shard_node.
The cat alias API no longer accepts local.
Elasticsearch 9 must be upgraded before using elasticsearch-py 9.0.0 or later; using the client with an Elasticsearch 8 server will fail.
The Elasticsearch-DSL package is merged into the Elasticsearch Python package.
Deprecated Elasticsearch() options are removed.
The Simulate data ingestion API parameter is renamed from index_template_subtitutions to index_template_substitutions.
The Alias exists API no longer accepts local.
The Get alias API no longer accepts local.
The experimental Get field usage stats API no longer accepts wait_for_active_shards.
The Index segments API no longer accepts verbose.
The Get trained model configuration info API no longer accepts include_model_definition.
The Search API no longer accepts min_compatible_shard_node.
The Logout of OpenID Connect API parameter is renamed from access_token to token.
The Unfreeze an index API is removed.
The deprecated url_prefix option is removed.
The deprecated use_ssl option is removed.
Security 1
Index names are sanitized in the ES|QL query builder.
Deprecations 2
Deprecates
confidence_intervalbecause Lucene 10.4 computes it automatically.Warnings are added for private APIs.
New APIs and options 162
Adds an API to delete a data source.
Adds an API to get a data source.
Adds an API to put a data source.
doc_values now accepts a DocValuesConfig object on all field types.
Adds the DocValuesConfig type for configuring doc_values on all field types.
Adds the encryption.reset API.
Adds the preserve_leaf_arrays attribute to the Flattened field.
Adds the route_slice parameter to the indices.validate_query API.
Adds the routing parameter to the indices.validate_query API.
Adds the inference.delete_region_policy API.
Adds the inference.get_region_policy API.
Adds the inference.put_region_policy API.
Adds the stats parameter to the search API.
Adds the search_after parameter to the synonyms.get_synonym API.
Adds the append parameter to the synonyms.put_synonym API.
Adds the project_routing parameter to the terms_enum API.
Adds the basic parameter to the transform.get_transform_stats API.
The QueryVectorBuilder type gains an embedding attribute.
The InnerHits type gains a field attribute.
The DenseVectorIndexOptions type gains a flat_index_threshold attribute.
Retries can use an optional backoff delay strategy.
Adds the return_intermediate_results parameter to the async_search.get API.
Adds data stream support to the DSL.
Adds the project_routing parameter to esql.async_query.
Adds the time_zone parameter to esql.async_query.
Adds the project_routing parameter to esql.query.
Adds the time_zone parameter to esql.query.
Adds the _es_name parameter to all subclasses of Field.
Adds the inference.embedding API.
Adds the inference.put_fireworksai API.
Adds the es_name parameter to the mapped_field function.
Adds a script attribute to the MultiTermLookup type.
Adds the project.create_many_routing API.
Adds the project.create_routing API.
Adds the project.delete_routing API.
Adds the project.get_many_routing API.
Adds the project.get_routing API.
Adds a lookup attribute to the QueryVectorBuilder type.
Adds the group_by parameter to the reindex_rethrottle API.
Adds the security.clone_api_key API.
The client constructor accepts a server_mode parameter.
Adds the name parameter to streams.logs_disable.
Adds the name parameter to streams.logs_enable.
Adds the should_parse_recursively parameter to text_structure.find_field_structure.
Adds the should_parse_recursively parameter to text_structure.find_message_structure.
Adds the should_parse_recursively parameter to text_structure.find_structure.
Adds the circuit breaker API.
Adds the on_disk_rescore argument to DenseVectorIndexOptions.
Adds new and updates existing ES|QL functions in the query builder for 9.3 and Serverless.
Adds an experimental API to delete a view.
Adds an experimental API to get a view.
Adds an experimental API to create or update a view.
Adds the ExponentialHistogram field.
Adds the time_series_metric argument to the Histogram field.
Adds an experimental API to delete sample configuration.
Adds an experimental API to get all sample configuration.
Adds an experimental API to get a sample.
Adds an experimental API to get sample configuration.
Adds an experimental API to get sample statistics.
Adds the downsampling_method argument to the data lifecycle API.
Adds an experimental API to create or update sample configuration.
Adds an API to configure Groq inference.
Adds an API to configure NVIDIA inference.
Adds an API to configure OpenShift AI inference.
Adds the return_documents argument to the rerank API.
Adds the top_n argument to the rerank API.
Adds the close_job argument to the stop datafeed API.
Adds a field supporting dense vectors based on numpy arrays.
Adds a helper function to pack dense vectors for efficient uploading.
Adds the project_routing argument to the Serverless project tags API.
Adds certificate_identity to the create cross-cluster API key API.
Adds certificate_identity to the update cross-cluster API key API.
Adds the slices argument to the UpdateByQueryResponse type.
Adds the allow_closed argument to cat.segments.
Adds the allow_no_indices argument to cat.segments.
Adds the expand_wildcards argument to cat.segments.
Adds the ignore_available argument to cat.segments.
Adds the ignore_throttled argument to cat.segments.
Adds the requests_per_second argument to delete_by_query_rethrottle.
Adds the chunking_settings argument to inference.put_watsonxai.
Adds the id argument to ml.stop_trained_model_deployment.
Adds the requests_per_second argument to reindex_rethrottle.
Adds the transform.get_node_stats API.
Adds the requests_per_second argument to update_by_query_rethrottle.
Adds the project_routing parameter to async_search.submit.
The DSL now supports passing inner documents as AttrDict instances.
Adds the CartesianBounds aggregation to the DSL.
Adds the CartesianCentroid aggregation to the DSL.
Adds the bytes parameter to various APIs in the cat namespace.
Adds the time parameter to various APIs in the cat namespace.
Adds the project_routing parameter to cat.count.
Adds the ChangePoint aggregation to the DSL.
Adds the project_routing parameter to count.
Recently added field classes are now available as top-level package exports.
Adds the project_routing parameter to eql.search.
Adds the include_execution_metadata parameter to esql.async_query.
Adds the include_execution_metadata parameter to esql.query.
DSL searches from Document and AsyncDocument now include the exclude_vectors option; these queries require Elasticsearch 9.1.0 or newer.
Adds the project_routing parameter to field_caps.
The ES|QL query builder adds the FUSE command.
Adds the project_routing parameter to indices.resolve_index.
Adds the index_template parameter to indices.simulate_index_template.
Adds the inference.contextualai API.
Adds the input_type parameter to inference.text_embedding.
Adds the field_access_pattern parameter to ingest.put_pipeline.
The ES|QL query builder adds the INLINE STATS command.
Adds the visit_percentage parameter to the Knn query.
Adds the project_routing parameter to msearch.
Adds the project_routing parameter to msearch_template.
Adds the project_routing parameter to open_point_in_time.
Adds the project.tags API in the project namespace.
The DSL module adds Pydantic integration.
Adds the project_routing parameter to search_mvt.
Adds the project_routing parameter to search.
Adds the project_routing parameter to search_template.
Adds the security.get_stats API.
Adds the fields parameter to the SemanticText field.
Adds the sparse_vector field to the SemanticTextIndexOptions type.
Adds the p_value parameter to the SignificantTerms aggregation.
Adds the project_routing parameter to sql.query.
Adds a flush_after_seconds option to streaming_bulk().
Adds the streams.logs_disable API.
Adds the streams.logs_enable API.
Adds the streams.status API.
Trio is supported when using the HTTPX async client.
The ES|QL query builder adds the TS command.
Adds the index_options parameter to the SemanticText field.
An API is added to stop an asynchronous ES|QL query.
The Boolean field adds ignore_malformed.
The Boolean field adds on_script_error.
The Boolean field adds script.
The Boolean field adds time_series_dimension.
Elastic Inference Service adds chat completion.
The Delete connector API adds the hard parameter to support soft-deletes in connectors.
The Get Connector API adds include_deleted to support soft-deletes in connectors.
The List Connector API adds include_deleted to support soft-deletes in connectors.
The GeoShape field adds index.
Create, Index, Update, and Bulk APIs add include_source_on_error.
An API is added to create an index from a source index.
The Create API adds if_primary_term.
The Create API adds if_seq_no.
The Create API adds op_type.
The Create API adds require_alias.
The Create API adds require_data_stream.
The Alias exists API adds master_timeout.
The Check index templates API adds flat_settings.
The Check index templates API adds local.
The Get alias API adds master_timeout.
The Update index settings API adds reopen.
The Reload search analyzer API adds resource.
The Roll over to a new index API adds lazy.
The Simulate index template APIs add cause.
The Simulate index template APIs add create.
Inference APIs are added for Alibaba Cloud AI Search, Amazon Bedrock, Anthropic, Azure AI Studio, Azure OpenAI, Cohere, Elasticsearch, ELSER, Google AI Studio, Google Vertex AI, Hugging Face, Jina AI, Mistral, OpenAI, and Voyage AI.
Migrate to data tiers routing APIs add master_timeout.
The Start a trained model deployment API adds the adaptive_allocations body field.
The Update a trained model deployment API adds the adaptive_allocations body field.
The Open point in time API adds max_concurrent_shard_requests.
APIs are added to reindex legacy backing indices.
The Resolve Cluster API adds timeout.
The SemanticText field adds search_inference_id.
The Create snapshot API adds expand_wildcards.
Behavior and default changes 2
Changes the
inference_iddefault to.jina-embeddings-v5-text-smallwhen the Elastic Inference Service is available.The ping operation is instrumented with OTel.
Tooling 1
Positional arguments in DSL generated classes are explicit, clarifying how those classes accept arguments.
Fixes and other changes 10
Includes the missing
auto_calibrateproperty.Includes the missing
bitsproperty.Includes the missing
cluster_sizeproperty.Includes the missing
default_visit_percentageproperty.Includes the missing
preconditionproperty.Forwards opaque_id in async_scan.
The DSL handles document attributes whose names collide with a method.
ES|QL updates for 9.4 and Serverless.
Relative imports fix package imports for elasticsearch9.
A missing assignment in the ES|QL query builder is fixed.
elasticsearch 867 changes
Breaking changes 32
Responses are objects with meta for response metadata and body for a typed body.
Introduces an API-layer exception distinct from transport-layer errors; transport errors now come from elastic-transport.
User-defined body parameters have semantic names, such as using document instead of body for index.
Removes the deprecated local parameter.
Removes the deprecated allow_no_datafeeds parameter.
Removes the deprecated allow_no_jobs parameter.
Removes the deprecated size parameter.
Defaults to compatibility mimetypes that request response compatibility with Elasticsearch 8.x.
Removes the deprecated size parameter.
Removes the parameter from many document and index APIs.
The client checks that a compatible version of the transport package is installed.
The client transport layer now uses the elastic-transport package.
Removes the default localhost URL; connections must specify scheme, host, and port or use cloud_id.
Removes the module; its functionality has moved to elastic-transport.
Removes the deprecated API.
Removes the deprecated API.
Removes the deprecated API.
Removes the deprecated API.
Removes the deprecated copy_settings parameter.
Removes the deprecated API.
Removes the deprecated allow_no_jobs parameter.
Removes the deprecated API.
Removes the deprecated allow_no_datafeeds parameter.
Removes the deprecated allow_no_datafeeds parameter.
Removes the deprecated allow_no_jobs parameter.
Removes the deprecated allow_no_jobs parameter.
Removes the deprecated allow_no_jobs parameter.
API methods no longer accept positional arguments; all API parameters must be keyword-only.
Python 2.7 is no longer supported; the library supports only Python 3.6+.
Python 3.5 is no longer supported; the library supports only Python 3.6+.
Removes the deprecated API.
Removes the deprecated size parameter.
Deprecations 12
Deprecates the body parameter on all APIs.
Deprecates the module; it will be removed in a future version.
Deprecates the verbose parameter.
Deprecates the accept_enterprise parameter.
Deprecates setting api_key as a transport option directly; use the .options() method instead.
Deprecates setting headers as a transport option directly; use the .options() method instead.
Deprecates setting http_auth as a transport option directly; use the .options() method instead.
Deprecates setting ignore as a transport option directly; use the .options() method instead.
Deprecates setting opaque_id as a transport option directly; use the .options() method instead.
Deprecates setting request_timeout as a transport option directly; use the .options() method instead.
Deprecates the params parameter on all APIs.
Deprecates the accept_enterprise parameter.
New APIs and options 22
Adds the API for deleting data stream options.
Adds the API for retrieving data stream options.
Adds the API for setting data stream options.
Adds the indices.get_data_stream_settings API.
Adds the indices.put_data_stream_settings API.
API methods now have parameters corresponding to JSON request body fields.
Adds access to HTTP response metadata on an API error.
Adds a parameter for specifying username and password authentication.
Adds a parameter for specifying an HTTP bearer token or service token.
Adds the time parameter.
Adds a top-level method for modifying transport options.
Renames JSONSerializer to JsonSerializer; the old name remains available as a backwards-compatible alias.
Adds the experimental knn_search API.
Adds the timeout parameter.
Adds an experimental API for inferring a trained model deployment.
Adds an experimental API for putting a trained model definition part.
Adds an experimental API for putting trained model vocabulary.
Adds an experimental API for starting a trained model deployment.
Adds an experimental API for stopping a trained model deployment.
Adds the security.enroll_kibana API.
Adds the security.enroll_node API.
The API now accepts multiple snapshots.
Behavior and default changes 1
AsyncElasticsearch is always available, whether or not aiohttp is installed.