|
| 1 | +## 8.0.0 |
| 2 | + |
| 3 | +First release for the `8.x` branch with a few major changes. |
| 4 | + |
| 5 | +- Tested versions of Ruby for 8.0.0: Ruby (MRI) 2.6, 2.7, 3.0 and 3.1, JRuby 9.3. |
| 6 | + |
| 7 | +### Client |
| 8 | + |
| 9 | +#### Elastic Transport |
| 10 | + |
| 11 | +The code for the dependency `elasticsearch-transport` has been promoted to [its own repository](https://github.com/elastic/elastic-transport-ruby/) and the project and gem have been renamed to [`elastic-transport`](https://rubygems.org/gems/elastic-transport). This gem now powers [`elasticsearch`](https://rubygems.org/gems/elasticsearch) and [`elastic-enterprise-search`](https://rubygems.org/gems/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`. |
| 12 | + |
| 13 | +This will allow us to better address maintainance in both clients and the library itself. |
| 14 | + |
| 15 | +### API |
| 16 | + |
| 17 | +The `elasticsearch-api` library has been generated based on the Elasticsearch 8.0.0 REST specification. |
| 18 | + |
| 19 | +#### X-Pack Deprecation |
| 20 | + |
| 21 | +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`. |
| 22 | + |
| 23 | +#### Parameter checking was removed |
| 24 | + |
| 25 | +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. |
| 26 | + |
| 27 | +#### Response object |
| 28 | + |
| 29 | +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: |
| 30 | + |
| 31 | +```ruby |
| 32 | +elastic_ruby(main)> response = client.info |
| 33 | +=> #<Elasticsearch::API::Response:0x000055752b0c50a8 |
| 34 | + @response= |
| 35 | + #<Elastic::Transport::Transport::Response:0x000055752b0c50f8 |
| 36 | + @body= |
| 37 | + {"name"=>"instance", |
| 38 | + "cluster_name"=>"elasticsearch-8-0-0-SNAPSHOT-rest-test", |
| 39 | + "cluster_uuid"=>"oIfRARuYRGuVYybjxQJ87w", |
| 40 | + "version"=> |
| 41 | + {"number"=>"8.0.0-SNAPSHOT", |
| 42 | + "build_flavor"=>"default", |
| 43 | + "build_type"=>"docker", |
| 44 | + "build_hash"=>"7e23c54eb31cc101d1a4811b9ab9c4fd33ed6a8d", |
| 45 | + "build_date"=>"2021-11-04T00:21:32.464485627Z", |
| 46 | + "build_snapshot"=>true, |
| 47 | + "lucene_version"=>"9.0.0", |
| 48 | + "minimum_wire_compatibility_version"=>"7.16.0", |
| 49 | + "minimum_index_compatibility_version"=>"7.0.0"}, |
| 50 | + "tagline"=>"You Know, for Search"}, |
| 51 | + @headers={"X-elastic-product"=>"Elasticsearch", "content-type"=>"application/json", "content-length"=>"567"}, |
| 52 | + @status=200>> |
| 53 | +elastic_ruby(main)> response.status |
| 54 | +=> 200 |
| 55 | +elastic_ruby(main)> response.headers |
| 56 | +=> {"X-elastic-product"=>"Elasticsearch", "content-type"=>"application/json", "content-length"=>"567"} |
| 57 | +elastic_ruby(main)> response['name'] |
| 58 | +=> "instance" |
| 59 | +elastic_ruby(main)> response['tagline'] |
| 60 | +=> "You Know, for Search" |
| 61 | +``` |
| 62 | + |
| 63 | +Please [let us know if you find any issues](https://github.com/elastic/elasticsearch-ruby/issues). |
| 64 | + |
1 | 65 | ## 7.17.0
|
2 | 66 |
|
3 | 67 | - Drops Ruby 2.5 from the test matrix. Support for Ruby 2.5 was dropped March 2021.
|
|
0 commit comments