You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update Elasticsearch client references for v8 gem namespaces
The elasticsearch-ruby v8 gem reorganized its module hierarchy:
- The transport client moved from Elasticsearch::Transport::Client
to Elasticsearch::Client
- Transport errors moved from Elasticsearch::Transport::Transport::Errors
to Elastic::Transport::Transport::Errors
Update documentation and YARD annotations to reflect these changes.
* Add Chewy 7→8 / Elasticsearch 7→8 migration guide
The migration guide previously only covered up to the Chewy 6→7
upgrade path. This adds a comprehensive section for users upgrading
to Chewy 8 / Elasticsearch 8, covering:
- Minimum Ruby (3.2) and Rails (7.2) version requirements
- elasticsearch gem version bump (>= 8.14, < 9.0)
- Namespace changes from elasticsearch-transport to elastic-transport
- Transport logger/tracer configuration changes
- Chewy.massacre / delete_all restriction due to ES 8 defaults
- Elasticsearch 8 security-by-default considerations
- Recommended rolling upgrade procedure
Closestoptal#1004
* Update documented Ruby compatibility to include 4.0
PR toptal#1003 added Ruby 4.0 support but the README still listed
3.2-3.4. Bump the documented range to 3.2-4.0 to match.
---------
Co-authored-by: Alfonso Uceda <alfonso.uceda@toptal.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@
4
4
5
5
### Changes
6
6
7
+
*[#1010](https://github.com/toptal/chewy/pull/1010): Add Chewy 7/ES 7 to Chewy 8/ES 8 migration guide and fix stale `Elasticsearch::Transport` namespace references in docs. ([@mattmenefee][])
7
8
*[#1011](https://github.com/toptal/chewy/pull/1011): Replace deprecated `Sidekiq::Testing` API with new `Sidekiq 8.1+` testing API and silence Sidekiq logger during spec runs. ([@mattmenefee][], [@mjankowski][])
8
9
*[#1013](https://github.com/toptal/chewy/pull/1013): Fix `drop_indices` test helper to use `format: 'json'` for ES version portability. If you define a custom `drop_indices` helper in your test suite, update it to use `Chewy.client.cat.indices(format: 'json')` instead of parsing the text-format response. ([@mattmenefee][])
9
10
*[#1014](https://github.com/toptal/chewy/pull/1014): Improve contributing documentation with development setup instructions, PR workflow, and grammar fixes. ([@mattmenefee][])
Copy file name to clipboardExpand all lines: docs/configuration.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ development:
25
25
26
26
> **Not using Rails?** You can skip `chewy.yml` entirely and configure Chewy with `Chewy.settings = {...}`. See the [Non-Rails Usage](non_rails.md) guide.
27
27
28
-
The resulting config merges both hashes. Client options are passed as is to `Elasticsearch::Transport::Client` except for the `:prefix`, which is used internally by Chewy to create prefixed index names:
28
+
The resulting config merges both hashes. Client options are passed as is to `Elasticsearch::Client` except for the `:prefix`, which is used internally by Chewy to create prefixed index names:
Copy file name to clipboardExpand all lines: migration_guide.md
+30-4Lines changed: 30 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,32 @@ This document outlines the steps you need to take when migrating between major v
4
4
Chewy and Elasticsearch. For simplicity's sake the guide will assume that you're using
5
5
Chewy alongside a matching Elasticsearch version.
6
6
7
+
## Chewy 7/Elasticsearch 7 to Chewy 8/Elasticsearch 8
8
+
9
+
In order to upgrade Chewy 7/Elasticsearch 7 to Chewy 8/Elasticsearch 8 in the most seamless manner you have to:
10
+
11
+
* Upgrade to the latest 7.x stable release (Chewy 7.6.0, Elasticsearch 7.17)
12
+
* Study carefully [Breaking changes in 8.0](https://www.elastic.co/guide/en/elasticsearch/reference/8.17/migrating-8.0.html), make sure your application conforms
13
+
* Upgrade Ruby to >= 3.2 and Rails/ActiveSupport to >= 7.2 — Chewy 8 drops support for older versions
* The `elasticsearch-transport` gem was replaced by `elastic-transport`, moving all error classes from the `Elasticsearch::Transport` namespace to `Elastic::Transport`. Update any `rescue` clauses:
* Handle the new `Chewy.massacre` / `delete_all` restriction:
23
+
* Elasticsearch 8 disables wildcard index deletion by default (`action.destructive_requires_name`). `Chewy.massacre` now raises `Chewy::FeatureDisabled` unless explicitly enabled
24
+
* To continue using `Chewy.massacre`, add `Chewy.settings[:delete_all_enabled] = true` to your Chewy initializer (e.g. `config/initializers/chewy.rb`) **and** configure your ES cluster with `action.destructive_requires_name: false`
25
+
* In test suites, consider switching to targeted index deletion instead of `Chewy.massacre`
26
+
* Configure Elasticsearch 8 security:
27
+
* ES 8 enables security features by default. Ensure your Chewy configuration includes proper authentication (username/password or API key) and SSL/TLS settings as needed.
28
+
* Run your test suite on Chewy 8 / Elasticsearch 8
29
+
* Run manual tests on Chewy 8 / Elasticsearch 8
30
+
* Upgrade to Chewy 8
31
+
* Perform a [rolling upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/8.17/rolling-upgrades.html) of Elasticsearch
32
+
7
33
## Chewy 6/Elasticsearch 6 to Chewy 7/Elasticsearch 7
8
34
9
35
In order to upgrade Chewy 6/Elasticsearch 6 to Chewy 7/Elasticsearch 7 in the most seamless manner you have to:
@@ -13,12 +39,12 @@ In order to upgrade Chewy 6/Elasticsearch 6 to Chewy 7/Elasticsearch 7 in the mo
13
39
* Run your test suite on Chewy 7.0 / Elasticsearch 7
14
40
* Run manual tests on Chewy 7.0 / Elasticsearch 7
15
41
* Upgrade to Chewy 7.0
16
-
* The “total hits” counter is an integer for ES versions < 7 and an object (hash) for the versions starting from 7.0.0. Elasticsearch added a special option, `rest_total_hits_as_int`, to ease the upgrade, that could be appended to any request and results in the old “total hits” format. Unfortunately, this option is not recognized by ES versions prior to 7.0.0, which means that we have to check the version to decide if we need this option.
42
+
* The "total hits" counter is an integer for ES versions < 7 and an object (hash) for the versions starting from 7.0.0. Elasticsearch added a special option, `rest_total_hits_as_int`, to ease the upgrade, that could be appended to any request and results in the old "total hits" format. Unfortunately, this option is not recognized by ES versions prior to 7.0.0, which means that we have to check the version to decide if we need this option.
17
43
Normally Chewy does memoization of the current ES version, but this might be inappropriate for the upgrade, as the version changes live.
18
-
To handle that we have 2 versions of Chewy for this stage of the upgrade: 7.0.0 and 7.0.1. Version 7.0.0 does the memoization and version 7.0.1 requests the current version on every search request.
44
+
To handle that we have 2 versions of Chewy for this stage of the upgrade: 7.0.0 and 7.0.1. Version 7.0.0 does the memoization and version 7.0.1 requests the current version on every search request.
19
45
* You can use the 7.0.0 version if it's fine for you to have an application restart immediately after ES cluster upgrade.
20
46
* If you're using the 7.0.1 version you might be interested in keeping the timeframe between this step and updating to Chewy 7.1 as small as possible, as version 7.0.1 skips ES version memoization for search requests to help dynamically detect ES version. This leads to an extra version request on each search request, i.e. could affect the overall performance/latency of the search and a load of ES cluster.
21
-
* Perform a [rolling upgrade](https://www.elastic.co/guide/en/elasticsearch/reference//rolling-upgrades.html) of Elasticsearch
47
+
* Perform a [rolling upgrade](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/rolling-upgrades.html) of Elasticsearch
22
48
* Run your test suite on Chewy 7.1 / Elasticsearch 7
23
49
* Run manual tests on Chewy 7.1 / Elasticsearch 7
24
50
* Upgrade to Chewy 7.1
@@ -48,7 +74,7 @@ In order to upgrade Chewy 5/Elasticsearch 5 to Chewy 6/Elasticsearch 6 in the mo
48
74
* Handle deprecation of `string` type & `not_analyzed` value for the `index` mapping parameter:
49
75
* replace fields with `{ type: 'string', index: 'not_analyzed'}` by `{type: 'keyword'}`
50
76
* replace fields with `{ type: 'string', index: 'analyzed'}` by `{type: 'text'}`
51
-
*`PathHierarchy` tokenizer' param `delimiter` now accepts only one argument, [others should be replaced by character filter](https://discuss.elastic.co/t/multichar-delimiter-in-path-hierarchy-tokenizer/16203)
77
+
*`PathHierarchy` tokenizer' param `delimiter` now accepts only one argument, [others should be replaced by character filter](https://discuss.elastic.co/t/multichar-delimiter-in-path-hierarchy-tokenizer/16203)
52
78
* Make sure you don't use any other of the [deprecated Elasticsearch 5 features](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/breaking-changes-6.0.html)
53
79
* Run your test suite on Chewy 6 / Elasticsearch 6
0 commit comments