Releases: elastic/elasticsearch-ruby
8.0.0.pre1
First pre-release of elasticsearch 8.x
🥳
Client
Elastic Transport
The code for the dependency elasticsearch-transport
has been promoted to its own repository and the project and gem have been renamed to elastic-transport
. This gem now powers elasticsearch
and elastic-enterprise-search
. The elasticsearch-transport
gem won't be maintained after the last release in the 7.x
branch, in favour of elastic-transport
.
API
X-Pack Deprecation
X-Pack has been deprecated. The elasticsearch-xpack
gem will no longer be maintained after the last release in the 7.x
branch. The "X-Pack" integration library codebase was merged into elasticsearch-api
. All the functionality is available from elasticsearch-api
. The xpack
namespace was removed for accessing any APIs other than _xpack
(client.xpack.info
) and _xpack/usage
(client.xpack.usage
). But APIs which were previously available through the xpack
namespace e.g.: client.xpack.machine_learning
are now only available directly: client.machine_learning
.
Parameter checking was removed
The code in elasticsearch-api
will no longer validate all the parameters sent. It will only validate the required parameters such as those needed to build the path for the request. But other API parameters are going to be validated by Elasticsearch. This provides better forwards and backwards compatibility in the client.
Response object
In previous versions of the client, calling an API endpoint would return the JSON body of the response. With 8.0
, we are returning a new Response object Elasticsearch::API::Response
. It still behaves like a Hash to maintain backwards compatibility, but adds the status
and headers
methods from the Elastic::Transport:Transport::Response
object:
elastic_ruby(main)> response = client.info
=> #<Elasticsearch::API::Response:0x000055752b0c50a8
@response=
#<Elastic::Transport::Transport::Response:0x000055752b0c50f8
@body=
{"name"=>"instance",
"cluster_name"=>"elasticsearch-8-0-0-SNAPSHOT-rest-test",
"cluster_uuid"=>"oIfRARuYRGuVYybjxQJ87w",
"version"=>
{"number"=>"8.0.0-SNAPSHOT",
"build_flavor"=>"default",
"build_type"=>"docker",
"build_hash"=>"7e23c54eb31cc101d1a4811b9ab9c4fd33ed6a8d",
"build_date"=>"2021-11-04T00:21:32.464485627Z",
"build_snapshot"=>true,
"lucene_version"=>"9.0.0",
"minimum_wire_compatibility_version"=>"7.16.0",
"minimum_index_compatibility_version"=>"7.0.0"},
"tagline"=>"You Know, for Search"},
@headers={"X-elastic-product"=>"Elasticsearch", "content-type"=>"application/json", "content-length"=>"567"},
@status=200>>
elastic_ruby(main)> response.status
=> 200
elastic_ruby(main)> response.headers
=> {"X-elastic-product"=>"Elasticsearch", "content-type"=>"application/json", "content-length"=>"567"}
elastic_ruby(main)> response['name']
=> "instance"
elastic_ruby(main)> response['tagline']
=> "You Know, for Search"
7.15.0
7.15.0
Client
- Compatibility with Elasticsearch v7.15.0 APIs.
- We've tested and added documentation on best practices for leveraging the client in a Function-as-a-Service (FaaS) environment to the official docs.
API
- New experimental endpoints:
indices.disk_usage
.indices.field_usage_stats
,nodes.clear_repositories_metering_archive
,get_repositories_metering_info
,search_mvt
- The
index
parameter is now required foropen_point_in_time
. - The
index_metric
parameter innodes.stats
adds theshards
option.
X-Pack
- New parameters for
ml.put_job
:ignore_unavailable
,allow_no_indices
,ignore_throttled
,expand_wildcards
. - New endpoint:
security.query_api_keys
.
7.14.1
7.14.1.pre
7.14.0
Client
Added check that client is connected to an Elasticsearch cluster. If the client isn't connected to a supported Elasticsearch cluster the UnsupportedProductError
exception will be raised.
This release changes the way in which the transport layer and the client interact. Previously, when using elasticsearch-transport
, Elasticsearch::Transport::Client
had a convenient wrapper, so it could be used as Elasticsearch::Client
. Now, we are decoupling the transport layer from the Elasticsearch client. If you're using the elasticsearch
gem, not much will change. It will instantiate a new Elasticsearch::Transport::Client
when you instantiate Elasticsearch::Client
and the endpoints from elasticsearch-api
will be available.
Elasticsearch::Client
has an attr_accessor
for the transport instance:
> client = Elasticsearch::Client.new
> client.transport.class
=> Elasticsearch::Transport::Client
> client.transport.transport.class
=> Elasticsearch::Transport::Transport::HTTP::Faraday
The interaction with elasticsearch-api
remains unchanged. You can use the API endpoints just like before:
> client.info
=> {"name"=>"instance",
"cluster_name"=>"elasticsearch",
"cluster_uuid"=>"id",
"version"=>
{"number"=>"7.14.0",
...
},
"tagline"=>"You Know, for Search"}
Or perform request directly from the client which will return an Elasticsearch::Transport::Response
object:
> client.perform_request('GET', '/')
# This is the same as doing client.transport.perform_request('GET', '/')
=> #<Elasticsearch::Transport::Transport::Response:0x000055c80bf94bc8
@body=
{"name"=>"instance",
"cluster_name"=>"elasticsearch",
"cluster_uuid"=>"id",
"version"=>
{"number"=>"7.14.0-SNAPSHOT",
...
},
"tagline"=>"You Know, for Search"},
@headers=
{"content-type"=>"application/json; charset=UTF-8",
"content-length"=>"571",
...
},
@status=200>
If you have any problems, please report them in this issue.
API
Code is now generated from Elastic artifacts instead of checked out code of Elasticsearch. See the Generator README for more info.
- Endpoints
msearch
,msearch_template
andsearch_template
removequery_and_fetch
anddfs_query_and_fetch
options from thesearch_type
parameter. - New parameter
include_repository
insnapshot.get
: (boolean) Whether to include the repository name in the snapshot info. Defaults to true.
X-Pack
X-Pack is being deprecated. The first time using xpack
on the client, a warning will be triggered. Please check this issue for more information.
- New endpoints:
index_lifecycle_management.migrate_to_data_tiers
,machine_learning.reset_job
,security.saml_authenticate
,security.saml_complete_logout
,security.saml_invalidate
,security.saml_logout
,security.saml_prepare_authentication
,security.saml_service_provider_metadata
,sql.delete_async
,sql.get_async
,sql.get_async_status
,terms_enum
. - New experimental endpoints:
machine_learning.infer_trained_model_deployment
,machine_learning.start_trained_model_deployment
,machine_learning.stop_trained_model_deployment
. - Deprecation:
indices.freeze
andindices.unfreeze
: Frozen indices are deprecated because they provide no benefit given improvements in heap memory utilization. They will be removed in a future release.
v7.14.0.pre
This is a pre-release, but there are some important changes coming in version 7.14.0 of the client:
Client
This release changes the way in which the transport layer and the client interact. Previously, when using elasticsearch-transport
, Elasticsearch::Transport::Client
had a convenient wrapper, so it could be used as Elasticsearch::Client
. Now, we are decoupling the transport layer from the Elasticsearch client. If you're using the elasticsearch
gem, not much will change. It will instantiate a new Elasticsearch::Transport::Client
when you instantiate Elasticsearch::Client
and the endpoints from elasticsearch-api
will be available.
Elasticsearch::Client
has an attr_accessor
for the transport instance:
> client = Elasticsearch::Client.new
> client.transport.class
=> Elasticsearch::Transport::Client
> client.transport.transport.class
=> Elasticsearch::Transport::Transport::HTTP::Faraday
The interaction with elasticsearch-api
remains unchanged. You can use the API endpoints just like before:
> client.info
=> {"name"=>"instance",
"cluster_name"=>"elasticsearch",
"cluster_uuid"=>"id",
"version"=>
{"number"=>"7.14.0",
...
},
"tagline"=>"You Know, for Search"}
Or perform request directly from the client which will return an Elasticsearch::Transport::Response
object:
> client.perform_request('GET', '/')
# This is the same as doing client.transport.perform_request('GET', '/')
=> #<Elasticsearch::Transport::Transport::Response:0x000055c80bf94bc8
@body=
{"name"=>"instance",
"cluster_name"=>"elasticsearch",
"cluster_uuid"=>"id",
"version"=>
{"number"=>"7.14.0-SNAPSHOT",
...
},
"tagline"=>"You Know, for Search"},
@headers=
{"content-type"=>"application/json; charset=UTF-8",
"content-length"=>"571",
...
},
@status=200>
If you have any problems, please report them in this issue.
7.13.3
- API Support for Elasticsearch version 7.13.3
DSL v0.1.10
- Adds auto_generate_synonyms_phrase_query (@andreasklinger) (3587ebe)
- Adds minimum_should_match option to bool filters (@MothOnMars) (c127661)
- Adds support for calendar_interval to DateHistogram (@tmaier) (a3214c5)
- Removes auto_generate_phrase_queries deprecated parameter (850eaba)
- Removes deprecated interval parameter (6b2e3ba)
- Use pry-byebug for MRI and pry-nav for JRuby
- Improves running tests (default value for cluster set to
http://localhost:9200
)
7.13.1
Client
- Support for Elasticsearch version 7.13.1
- Fixes thread safety issue in
get_connection
- [https://github.com//pull/1325](Pull Request).
7.13.0
Client
- Support for Elasticsearch version 7.13.0
- Adds support for compatibility header for Elasticsearch. If the environment variable 'ELASTIC_CLIENT_APIVERSIONING' is set to
true
or1
, the client will send the headersAccept
andContent-Type
with the following value:application/vnd.elasticsearch+json;compatible-with=7
. - Better detection of Elasticsearch and Enterprise Search clients in the meta header used by cloud.
API
- The REST API tests now use an artifact downloaded from the Elastic servers instead of depending of cloning
elasticsearch
locally. Check the README for more information. - New parameter
include_unloaded_segments
incat.nodes
,nodes.stats
: If set to true segment stats will include stats for segments that are not currently loaded into memory - New parameter
summary
iningest.get_pipeline
: Return pipelines without their definitions (default: false) - New parameter
index_details
insnapshot.get
: Whether to include details of each index in the snapshot, if those details are available. Defaults to false. - New endpoint
features.reset_features
,ingest/geo_ip_stats
- New experimental endpoints:
shutdown.delete_node
,shutdown.get_node
,shutdown.put_node
.
X-Pack
- Refactored test tasks, made it easier to run the tests by default.
- New experimental endpoints:
fleet.global_checkpoints
,searchable_snapshots.cache_stats
. - New beta endpoints:
security.clear_cached_service_tokens
,security.create_service_token
,security.delete_service_token
,security.get_service_accounts
,security.get_service_credentials
- New endpoints:
machine_learning.delete_trained_model_alias
,machine_learning.preview_data_frame_analytics
,machine_learning.put_trained_model_alias
. - APIs migrated from experimental or beta to stable:
machine_learning.delete_data_frame_analytics
,machine_learning.delete_trained_model
,machine_learning.estimate_model_memory
,machine_learning.explain_data_frame_analytics
,machine_learning.get_data_frame_analytics
,machine_learning.get_data_frame_analytics_stats
,machine_learning.get_trained_models
,machine_learning.get_trained_models_stats
,machine_learning.put_data_frame_analytics
,machine_learning.put_trained_model
,machine_learning.start_data_frame_analytics
,machine_learning.stop_data_frame_analytics
,machine_learning.update_data_frame_analytics
- New parameter
body
inmachine_learning.preview_datafeed
: The datafeed config and job config with which to execute the preview.