diff --git a/CHANGELOG-9.x.md b/CHANGELOG-9.x.md
deleted file mode 100644
index 226cd027fa..0000000000
--- a/CHANGELOG-9.x.md
+++ /dev/null
@@ -1,34 +0,0 @@
-# CHANGELOG 9.x
-## Ruby version
-
-Ruby 3.2 and up are tested and supported. At the time of release, we're testingb
-
-We follow Ruby’s own maintenance policy and officially support all currently maintained versions per [Ruby Maintenance Branches](https://www.ruby-lang.org/en/downloads/branches/).
-
-## Gem
-
-The size of both `elasticsearch` and `elasticsearch-api` gems will be smaller, since some unnecessary files that were being included in the gem have been removed. There's also been a lot of old code cleanup for `9.x`.
-
-The required Ruby version is set to `2.6` to keep compatiblity wit JRuby 9.3. However, we only test the code against currently supported Ruby versions.
-
-## Elasticsearch Serverless
-
-The CI build now runs tests to ensure compatibility with Elasticsearch Serverless. You can use this gem for your Serverless deployments.
-
-## Elasticsearch API
-
-* The source code is now based on `elasticsearch-specification`, so the API documentation is much more detailed and extensive.
-* Scroll APIs: Since sending the `scroll_id` as a parameter was deprecated, now it needs to be sent in the body for `clear_scroll`, `scroll`.
-* `indices.get_field_mapping` - `:fields` is a required parameter.
-* The functions in `utils.rb` that had names starting with double underscore have been renamed to remove these.
-
-### Development
-
-#### Testing
-
-The gem migrated away from the Elasticsearch REST API tests and test runner in CI. We now run the [Elasticsearch Client tests](https://github.com/elastic/elasticsearch-clients-tests/) with the [Elasticsearch Tests Runner](https://github.com/elastic/es-test-runner-ruby). This gives us more control on what we're testing and makes the Buildkite build way faster in Pull Requests and scheduled builds.
-
-#### Rake tasks
-
-* Some old rake tasks that were not being used have been removed. The rest were streamlined, the `es` namespace has been streamlined to make it easier to run Elasticsearch with Docker during development. The `docker` namespace was merged into `es`.
-* Elasticsearch's REST API Spec tests can still be ran with `rake test:deprecated:rest_api` and setting the corresponding value for the environment variable `TEST_SUITE` ('platinum' or 'free').
diff --git a/docs/reference/transport.md b/docs/reference/transport.md
index 74ec2c2ad2..a4d8721267 100644
--- a/docs/reference/transport.md
+++ b/docs/reference/transport.md
@@ -21,9 +21,11 @@ Currently these libraries are supported:
* [Typhoeus](https://github.com/typhoeus/typhoeus)
* [HTTPClient](https://rubygems.org/gems/httpclient)
* [Net::HTTP::Persistent](https://rubygems.org/gems/net-http-persistent)
+* [Excon](https://github.com/excon/faraday-excon)
+* [Async::HTTP](https://github.com/socketry/async-http-faraday)
::::{note}
-Use [Typhoeus](https://github.com/typhoeus/typhoeus) v1.4.0 or up since older versions are not compatible with Faraday 1.0.
+If using [Typhoeus](https://github.com/typhoeus/typhoeus), v1.4.0 or up is needed, since older versions are not compatible with Faraday 1.0.
::::
diff --git a/docs/release-notes/breaking-changes.md b/docs/release-notes/breaking-changes.md
index 047f7e9141..eea940aa58 100644
--- a/docs/release-notes/breaking-changes.md
+++ b/docs/release-notes/breaking-changes.md
@@ -14,11 +14,28 @@ Breaking changes can impact your Elastic applications, potentially disrupting no
% **Action**
Steps for mitigating deprecation impact.
% ::::
-% ## 9.0.0 [elasticsearch-ruby-client-900-breaking-changes]
+## 9.0.0 [elasticsearch-ruby-client-900-breaking-changes]
-% ::::{dropdown} Title of breaking change
-% Description of the breaking change.
-% For more information, check [PR #](PR link).
-% **Impact**
Impact of the breaking change.
-% **Action**
Steps for mitigating deprecation impact.
-% ::::
\ No newline at end of file
+### Scroll APIs need to send scroll_id in request body
+
+Sending the `scroll_id` as a parameter has been deprecated since version 7.0.0. It needs to be specified in the request body for `clear_scroll` and `scroll`.
+
+**Impact**
+
+Client code using `clear_scroll` or `scroll` APIs and the deprecated `scroll_id` as a parameter needs to be updated.
+
+**Action**
+
+If you are using the `clear_scroll` or `scroll` APIs, and sending the `scroll_id` as a parameter, you need to update your code to send the `scroll_id` as part of the request body:
+```ruby
+# Before:
+client.clear_scroll(scroll_id: scroll_id)
+# Now:
+client.clear_scroll(body: { scroll_id: scroll_id })
+
+# Before:
+client.scroll(scroll_id: scroll_id)
+# Now:
+client.scroll(body: { scroll_id: scroll_id })
+```
+% ::::
diff --git a/docs/release-notes/deprecations.md b/docs/release-notes/deprecations.md
index 6de975eb85..f1574b5278 100644
--- a/docs/release-notes/deprecations.md
+++ b/docs/release-notes/deprecations.md
@@ -7,6 +7,10 @@ Over time, certain Elastic functionality becomes outdated and is replaced or rem
Review the deprecated functionality for Elasticsearch Ruby Client. While deprecations have no immediate impact, we strongly encourage you update your implementation after you upgrade. To learn how to upgrade, check out [Upgrade](docs-content://deploy-manage/upgrade.md).
+## 9.0.0 [elasticsearch-ruby-client-900-deprecations]
+
+_No deprecations_
+
% ## Next version [elasticsearch-ruby-client-versionnext-deprecations]
% ::::{dropdown} Deprecation title
@@ -23,4 +27,4 @@ Review the deprecated functionality for Elasticsearch Ruby Client. While depreca
% For more information, check [PR #](PR link).
% **Impact**
Impact of deprecation.
% **Action**
Steps for mitigating deprecation impact.
-% ::::
\ No newline at end of file
+% ::::
diff --git a/docs/release-notes/index.md b/docs/release-notes/index.md
index c26ba12814..8e2e8b53c1 100644
--- a/docs/release-notes/index.md
+++ b/docs/release-notes/index.md
@@ -24,4 +24,33 @@ To check for security updates, go to [Security announcements for the Elastic sta
### Features and enhancements [elasticsearch-ruby-client-900-features-enhancements]
-### Fixes [elasticsearch-ruby-client-900-fixes]
\ No newline at end of file
+Ruby 3.2 and up are tested and supported for 9.0. Older versions of Ruby have reached their end of life. We follow Ruby’s own maintenance policy and officially support all currently maintained versions per [Ruby Maintenance Branches](https://www.ruby-lang.org/en/downloads/branches/). The required Ruby version is set to `2.6` to keep compatiblity wit JRuby 9.3. However, we only test the code against currently supported Ruby versions.
+
+#### Gem
+
+The size of both `elasticsearch` and `elasticsearch-api` gems is smaller than in previous versions. Some unnecessary files that were being included in the gem have now been removed. There has also been a lot of old code cleanup for the `9.x` branch.
+
+#### Elasticsearch Serverless
+
+With the release of `9.0`, the [Elasticsearch Serverless](https://github.com/elastic/elasticsearch-serverless-ruby) client has been discontinued. You can use this client to build your Elasticsearch Serverless Ruby applications. The Elasticsearch Serverless API is fully supported. The CI build for Elasticsearch Ruby runs tests to ensure compatibility with Elasticsearch Serverless.
+
+#### Elasticsearch API
+
+* The source code is now generated from [`elasticsearch-specification`](https://github.com/elastic/elasticsearch-specification/), so the API documentation is much more detailed and extensive. The value `Elasticsearch::ES_SPECIFICATION_COMMIT` is updated with the commit hash of elasticsearch-specification in which the code is based every time it's generated.
+* The API code has been updated for compatibility with Elasticsearch API v 9.0.
+* `indices.get_field_mapping` - `:fields` is a required parameter.
+* `knn_search` - This API has been removed. It was only ever experimental and was deprecated in v`8.4`. It isn't supported in 9.0, and only works when the header `compatible-with=8` is set. The search API should be used for all knn queries.
+* The functions in `utils.rb` that had names starting with double underscore have been renamed to remove these (e.g. `__listify` to `listify`).
+* **Namespaces clean up**: The API namespaces are now generated dynamically based on the elasticsearch-specification. As such, some deprecated namespace files have been removed from the codebase:
+ * The `rollup` namespace was removed. The rollup feature was never GA-ed, it has been deprecated since `8.11.0` in favor of downsampling.
+ * The `data_frame_deprecated`, `remote` namespace files have been removed, no APIs were available.
+ * The `shutdown` namespace was removed. It is designed for indirect use by ECE/ESS and ECK. Direct use is not supported.
+
+##### Testing
+
+The gem `elasticsearch-api` migrated away from the Elasticsearch REST API tests and test runner in CI. We now run the [Elasticsearch Client tests](https://github.com/elastic/elasticsearch-clients-tests/) with the [Elasticsearch Tests Runner](https://github.com/elastic/es-test-runner-ruby). This gives us more control on what we're testing and makes the Buildkite build way faster in Pull Requests and scheduled builds.
+
+### Fixes [elasticsearch-ruby-client-900-fixes]
+
+* Some old rake tasks that were not being used have been removed. The rest were streamlined, the `es` namespace has been streamlined to make it easier to run Elasticsearch with Docker during development. The `docker` task namespace was merged into `es`.
+* Elasticsearch's REST API Spec tests can still be ran with `rake test:deprecated:rest_api` and setting the corresponding value for the environment variable `TEST_SUITE` ('platinum' or 'free').
diff --git a/docs/release-notes/known-issues.md b/docs/release-notes/known-issues.md
index c84a5bea5a..d6f7517cfd 100644
--- a/docs/release-notes/known-issues.md
+++ b/docs/release-notes/known-issues.md
@@ -5,6 +5,10 @@ navigation_title: "Known issues"
# Elasticsearch Ruby Client known issues [elasticsearch-ruby-client-known-issues]
+## 9.0.0
+
+_No known issues_
+
% Use the following template to add entries to this page.
% :::{dropdown} Title of known issue
@@ -17,4 +21,4 @@ navigation_title: "Known issues"
% **Resolved**
% On [Month/Day/Year], this issue was resolved.
-:::
\ No newline at end of file
+% :::
diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/knn_search.rb b/elasticsearch-api/lib/elasticsearch/api/actions/knn_search.rb
deleted file mode 100644
index ff1db4780a..0000000000
--- a/elasticsearch-api/lib/elasticsearch/api/actions/knn_search.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-# Licensed to Elasticsearch B.V. under one or more contributor
-# license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright
-# ownership. Elasticsearch B.V. licenses this file to you under
-# the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# This code was automatically generated from the Elasticsearch Specification
-# See https://github.com/elastic/elasticsearch-specification
-# See Elasticsearch::ES_SPECIFICATION_COMMIT for commit hash.
-module Elasticsearch
- module API
- module Actions
- # Run a knn search.
- # NOTE: The kNN search API has been replaced by the +knn+ option in the search API.
- # Perform a k-nearest neighbor (kNN) search on a dense_vector field and return the matching documents.
- # Given a query vector, the API finds the k closest vectors and returns those documents as search hits.
- # Elasticsearch uses the HNSW algorithm to support efficient kNN search.
- # Like most kNN algorithms, HNSW is an approximate method that sacrifices result accuracy for improved search speed.
- # This means the results returned are not always the true k closest neighbors.
- # The kNN search API supports restricting the search using a filter.
- # The search will return the top k documents that also match the filter query.
- # A kNN search response has the exact same structure as a search API response.
- # However, certain sections have a meaning specific to kNN search:
- # * The document +_score+ is determined by the similarity between the query and document vector.
- # * The +hits.total+ object contains the total number of nearest neighbor candidates considered, which is +num_candidates * num_shards+. The +hits.total.relation+ will always be +eq+, indicating an exact value.
- # This functionality is Experimental and may be changed or removed
- # completely in a future release. Elastic will take a best effort approach
- # to fix any issues, but experimental features are not subject to the
- # support SLA of official GA features.
- #
- # @option arguments [String, Array] :index A comma-separated list of index names to search;
- # use +_all+ or to perform the operation on all indices. (*Required*)
- # @option arguments [String] :routing A comma-separated list of specific routing values.
- # @option arguments [Hash] :headers Custom HTTP headers
- # @option arguments [Hash] :body request body
- #
- # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-knn-search
- #
- def knn_search(arguments = {})
- request_opts = { endpoint: arguments[:endpoint] || 'knn_search' }
-
- defined_params = [:index].each_with_object({}) do |variable, set_variables|
- set_variables[variable] = arguments[variable] if arguments.key?(variable)
- end
- request_opts[:defined_params] = defined_params unless defined_params.empty?
-
- raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
-
- arguments = arguments.clone
- headers = arguments.delete(:headers) || {}
-
- body = arguments.delete(:body)
-
- _index = arguments.delete(:index)
-
- method = if body
- Elasticsearch::API::HTTP_POST
- else
- Elasticsearch::API::HTTP_GET
- end
-
- path = "#{Utils.listify(_index)}/_knn_search"
- params = Utils.process_params(arguments)
-
- Elasticsearch::API::Response.new(
- perform_request(method, path, params, body, headers, request_opts)
- )
- end
- end
- end
-end
diff --git a/elasticsearch-api/lib/elasticsearch/api/version.rb b/elasticsearch-api/lib/elasticsearch/api/version.rb
index e1d69fc8ff..b55f25b636 100644
--- a/elasticsearch-api/lib/elasticsearch/api/version.rb
+++ b/elasticsearch-api/lib/elasticsearch/api/version.rb
@@ -18,6 +18,6 @@
module Elasticsearch
module API
VERSION = '9.0.0'.freeze
- ES_SPECIFICATION_COMMIT = '1403bac9354d232024184bd992ecc76aaa9e68fa'.freeze
+ ES_SPECIFICATION_COMMIT = '2a24e33865256e85eaa8e2de9e793646f147c4df'.freeze
end
end
diff --git a/elasticsearch-api/spec/unit/actions/knn_search_spec.rb b/elasticsearch-api/spec/unit/actions/knn_search_spec.rb
deleted file mode 100644
index 2400b84238..0000000000
--- a/elasticsearch-api/spec/unit/actions/knn_search_spec.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# Licensed to Elasticsearch B.V. under one or more contributor
-# license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright
-# ownership. Elasticsearch B.V. licenses this file to you under
-# the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-require 'spec_helper'
-
-describe 'client#knn_search' do
- let(:expected_args) do
- [
- 'GET',
- 'foo/_knn_search',
- { },
- nil,
- {},
- { endpoint: 'knn_search', defined_params: { index: 'foo' } }
- ]
- end
-
- it 'performs the request' do
- expect(client_double.knn_search(index: 'foo')).to be_a Elasticsearch::API::Response
- end
-end
diff --git a/elasticsearch-api/spec/unit/perform_request_spec.rb b/elasticsearch-api/spec/unit/perform_request_spec.rb
index 0965b56e49..756a824bce 100644
--- a/elasticsearch-api/spec/unit/perform_request_spec.rb
+++ b/elasticsearch-api/spec/unit/perform_request_spec.rb
@@ -29,7 +29,7 @@
spec.module_namespace.flatten.first == 'rollup' ||
[
'scroll', 'clear_scroll', 'connector.last_sync', 'inference.put_eis', 'esql.get_query',
- 'esql.list_queries'
+ 'esql.list_queries', 'knn_search'
].include?(spec.endpoint_name)
# These are the path parts defined by the user in the method argument