Releases: elastic/elasticsearch-ruby
v9.1.0
Gem
Tested versions of Ruby for 9.1.0: Ruby (MRI) 3.2, 3.3, 3.4, head
, JRuby 9.3, JRuby 9.4 and JRuby 10.
Elasticsearch API
API updates
- Source code documentation and code has been updated with better formatting, updated links. It's also been updated to support common parameters and common cat parameters in APIs that support it (
error_trace
,filter_path
,human
,pretty
). The API reference documentation can be generated withrake doc
. esql.async_query
,esql.query
- addsallow_partial_results
boolean parameter. Iftrue
, partial results will be returned if there are shard failures, but the query can continue to execute on other clusters and shards. Iffalse
, the query will fail if there are any failures. To override the default behavior, you can set theesql.query.allow_partial_results
cluster setting tofalse
. Server default: true.indices.get_field_mapping
- removeslocal
parameter.synonyms.put_synonym
,synonyms.put_synonym_rule
- addrefresh
boolean parameter. Iftrue
, the request will refresh the analyzers with the new synonym rule and wait for the new synonyms to be available before returning.
New APIs
esql.get_query
(Experimental) - Get a specific running ES|QL query information.esql.list_queries
(Experimental) - Get running ES|QL queries information.indices.delete_data_stream_options
- Removes the data stream options from a data stream.indices.get_data_stream_options
- Get the data stream options configuration of one or more data streams.indices.get_data_stream_settings
- Get setting information for one or more data streams.indices.put_data_stream_options
- Update the data stream options of the specified data streams.indices.put_data_stream_settings
- Update data stream settings.indices.remove_block
- Remove an index block from an index.inference.put_custom
- Create a custom inference endpoint.inference.put_deepseek
- Create a DeepSeek inference endpoint.snapshot.repository_verify_integrity
(Experimental) - Verify the integrity of the contents of a snapshot repository. NOTE: This API is intended for exploratory use by humans. You should expect the request parameters and the response format to vary in future versions.streams.logs_disable
- Disable the Logs Streams feature for this cluster.streams.logs_enable
- Enable the Logs Streams feature for this cluster.streams.status
- Return the current status of the streams feature for each streams type.
v9.0.4
- Source code documentation and code has been updated to support common parameters and common cat parameters in APIs that support it (
error_trace
,filter_path
,human
,pretty
). The API reference documentation can be generated withrake doc
. - New API:
inference.put_custom
v8.19.0
Client
Tested versions of Ruby for 8.19.0: Ruby (MRI) 3.1, 3.2, 3.3, 3.4. JRuby 9.3, JRuby 9.4 and JRuby 10.
API changes
cluster.get_component_template
- Addsflat_settings
boolean parameter, return settings in flat format (default: false). Addssettings_filter
String parameter, filter out results, for example to filter out sensitive information.cluster.put_component_template
- Removestimeout
parameter, addscause
String parameter, used defined reason for creation.create
- Addsrequire_alias
andrequire_data_stream
boolean parameters, to specify required type to be created.eql.search
- Addsccs_minimize_roundtrips
,ignore_unavailable
,allow_no_indices
boolean parameters andexpand_wildcards
String parameter.esql.async_query
- Addsallow_partial_results
boolean parameter.esql.async_query_get
- Addsformat
String parameter (e.g. json, yaml).esql.query
- Addsallow_partial_results
boolean parameter.indices.recovery
- Addsignore_unavailable
,allow_no_indices
boolean parameters andexpand_wildcards
String parameter.msearch
- Addsignore_unavailable
,ignore_throttled
,allow_no_indices
,include_named_queries_score
boolean parameters,expand_wildcards
String parameter androuting
, a comma-separated list of specific routing values.open_point_in_time
- Addsmax_concurrent_shard_requests
parameter, the number of concurrent shard requests per node executed concurrently when opening this point-in-timereindex
- Addsrequire_alias
boolean parameter.search_mvt
- Addsgrid_agg
String parameter, aggregation used to create a grid forfield
.snapshot.repository_analyze
- Addsregister_operation_count
parameter, the minimum number of linearizable register operations to perform in total.
Time parameters master_timeout
and timeout
have been added to the following APIs:
-
index_lifecycle_management
:delete_lifecycle
get_lifecycle
put_lifecycle
start
stop
explain_lifecycle
- Onlymaster_timeout
-
ingest
:delete_geoip_database
delete_ip_location_database
put_geoip_database
put_ip_location_database
New APIs
indices.delete_data_stream_options
- Deletes the data stream options of the selected data streams.indices.get_data_stream_options
- Returns the data stream options of the selected data streams.indices.get_data_stream_settings
- Gets a data stream's settings.indices.put_data_stream_options
- Updates the data stream options of the selected data streams.indices.put_data_stream_settings
- Updates a data stream's settings.inference.put_amazonsagemaker
- Configure an Amazon SageMaker inference endpoint.inference.put_custom
- Configure a custom inference endpoint.inference.put_deepseek
- Configure a DeepSeek inference endpoint.
v9.0.3
- Adds
ccr
alias forcross_cluster_replication
andslm
alias forsnapshot_lifecycle_management
. - Tested for JRuby 10.0.0.
- General updates in source code docs.
v9.0.2
v9.0.1
v9.0.0
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. 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 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
, so the API documentation is much more detailed and extensive. The valueElasticsearch::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 v8.4
. It isn't supported in 9.0, and only works when the headercompatible-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
tolistify
). - 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 since8.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.
- The
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:
# 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 })
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 with the Elasticsearch Tests Runner. This gives us more control on what we're testing and makes the Buildkite build way faster in Pull Requests and scheduled builds.
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. Thedocker
task namespace was merged intoes
. - Elasticsearch's REST API Spec tests can still be ran with
rake test:deprecated:rest_api
and setting the corresponding value for the environment variableTEST_SUITE
('platinum' or 'free').
v8.18.0
API
New APIs:
esql.async_query_stop
- Stops a previously submitted async query request given its ID and collects the results.inference.chat_completion_unified
- Perform chat completion inferenceinference.completion
- Perform completion inferenceinference.put_alibabacloud
- Configure an AlibabaCloud AI Search inference endpointinference.put_amazonbedrock
- Configure an Amazon Bedrock inference endpointinference.put_anthropic
- Configure an Anthropic inference endpointinference.put_azureaistudio
- Configure an Azure AI Studio inference endpointinference.put_azureopenai
- Configure an Azure OpenAI inference endpointinference.put_cohere
- Configure a Cohere inference endpointinference.put_elasticsearch
- Configure an Elasticsearch inference endpointinference.put_elser
- Configure an ELSER inference endpointinference.put_googleaistudio
- Configure a Google AI Studio inference endpointinference.put_googlevertexai
- Configure a Google Vertex AI inference endpointinference.put_hugging_face
- Configure a HuggingFace inference endpointinference.put_jinaai
- Configure a JinaAI inference endpointinference.put_mistral
- Configure a Mistral inference endpointinference.put_openai
- Configure an OpenAI inference endpointinference.put_voyageai
- Configure a VoyageAI inference endpointinference.put_watsonx
- Configure a Watsonx inference endpointinference.rerank
- Perform reranking inferenceinference.sparse_embedding
- Perform sparse embedding inferenceinference.stream_inference
renamed toinference.stream_completion
- Perform streaming completion inference.inference.text_embedding
- Perform text embedding inference
Updated APIs:
bulk
,create
,index
,update
- Add Boolean parameter:include_source_on_error
, if to include the document source in the error message in case of parsing errors (defaults to true).cat.segments
- Adds Boolean parameter
:local
, return local information, do not retrieve the state from master node (default: false). - Adds Time parameter
:master_timeout
, explicit operation timeout for connection to master node.
- Adds Boolean parameter
cat.tasks
- Adds Time parameter
:timeout
, period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. - Adds Boolean parameter
:wait_for_completion
, iftrue
, the request blocks until the task has completed.
- Adds Time parameter
eql.search
- Adds Boolean parameter
:allow_partial_search_results
, control whether the query should keep running in case of shard failures, and return partial results. - Adds Boolean parameter
:allow_partial_sequence_results
, control whether a sequence query should return partial results or no results at all in case of shard failures. This option has effect only if [allow_partial_search_results] is true.
- Adds Boolean parameter
index_lifecycle_management.delete_lifecycle
,index_lifecycle_management.explain_lifecycle
,index_lifecycle_management.get_lifecycle
,index_lifecycle_management.put_lifecycle
,index_lifecycle_management.start
,index_lifecycle_management.stop
, remove:master_timeout
,:timeout
parameters.indices.resolve_cluster
- Adds:timeout
parameter,:name
no longer a required parameter.indices.rollover
- Removes target_failure_store parameter.ingest.delete_geoip_database
,ingest.delete_ip_location_database
,put_geoip_database
,put_ip_location_database
remove:master_timeout
,:timeout
parameters.machine_learning.start_trained_model_deployment
- Adds body request parameter, the settings for the trained model deployment.
v8.17.2
API
New APIs:
esql.async_query_delete
indices.get_data_lifecycle_stats
inference.update
security.delegate_pki
Updates APIs:
async_search.submit
- Addskeep_alive
Time parameter.indices.put_template
- Addscause
String parameter.xpack.info
- Addshuman
parameter for human-readable information.- Timeout parameters updated:
:master_timeout
(Time), explicit operation timeout for connection to master node.:timeout
(Time), explicit operation timeout.- Added to:
index_lifecycle_management.delete_lifecycle
- adds both.index_lifecycle_management.delete_lifecycle
- addsmaster_timeout
.index_lifecycle_management.get_lifecycle
- adds both.index_lifecycle_management.put_lifecycle
- adds both.index_lifecycle_management.start
- adds both.index_lifecycle_management.stop
- adds both.ingest.delete_geoip_database
- adds both.ingest.delete_geoip_location_database
- adds both.ingest.put_geoip_database
- adds both.ingest.put_ip_location_database
- adds both.license.post_start_trial
- removestimeout
.shutdown.delete_node
- adds both.shutdown.put_node
- adds both.snapshot_lifecycle_management.delete_lifecycle
- adds both.snapshot_lifecycle_management.execute_lifecycle
- adds both.snapshot_lifecycle_management.execute_retention
- adds both.snapshot_lifecycle_management.get_lifecycle
- adds both.snapshot_lifecycle_management.get_stats
- adds both.snapshot_lifecycle_management.get_status
- adds both.snapshot_lifecycle_management.put_lifecycle
- adds both.
- Added to:
APIs promoted from Experimental to Stable:
inference.delete
inference.get
inference.inference
inference.put
inference.stream_inference
v8.17.1
- Fixes ScrollHelper issue #2556 - There was a bug where an additional search (with scroll) request was made to Elasticsearch for each resulting hit. It was rewritten so that the docs are retrieved as needed and the Helper instance doesn't store documents internally, with big savings in memory and requests to Elasticsearch.