Commit 98955eb
committed
Add Elasticsearch 9.x support
Elasticsearch 9.x introduced breaking changes to the elasticsearch-ruby
client gem that prevent Chewy from working with ES 9 clusters:
1. The scroll API now requires scroll_id nested under a body: key
({scroll: '1m', body: {scroll_id: '...'}}) rather than as a
top-level parameter. Without this, scroll requests raise an
ArgumentError in elasticsearch-ruby 9.x.
2. API responses are now wrapped in Elasticsearch::API::Response objects
instead of returning raw hashes/arrays. Code that calls .map or
other Enumerable methods directly on responses (e.g. cat.indices)
must now call .body first to access the underlying data.
3. The '_type' field was removed from search responses in ES 7+ and
the elasticsearch-ruby 9.x client no longer includes it. All
references to '_type' have been removed: mock response helpers,
EVERFIELDS, wrapper accessors, and documentation examples.
4. The elasticsearch Ruby gem at version 9.x sends a compatible-with=9
header that ES 8.x servers reject. CI matrix entries that test
against ES 8.x must pin the gem to ~> 8.14.
Changes:
- Widen elasticsearch gem dependency from < 9.0 to < 10.0
- Restructure perform_scroll to nest scroll_id under body:, which is
compatible with both elasticsearch-ruby 8.x and 9.x
- Access .body on cat.indices response in the drop_indices test helper
- Remove '_type' from Minitest and RSpec mock response helpers,
EVERFIELDS, Index::Wrapper accessors, and README examples
- Remove obsolete '_parent' from EVERFIELDS
- Add elasticsearch version matrix to CI (9.3.1 default with 8.15.0
spot-checks) using dynamic service container images
- Pin elasticsearch gem to ~> 8.14 in CI for ES 8.x matrix entries
- Add Ruby 3.4 / Rails 8.0 / ES 8.15.0 CI matrix entry
- Add scroll body format assertion in scrolling specs
- Expand migration guide with code examples, gem pinning guidance,
corrected URLs, and more detailed upgrade steps
- Consolidate CHANGELOG entries into single item with sub-bullets
- Default docker-compose ES image to 9.3.1
- Bump version to 9.0.01 parent 680080a commit 98955eb
17 files changed
Lines changed: 98 additions & 24 deletions
File tree
- .github/workflows
- lib/chewy
- index
- minitest
- rspec
- search
- spec
- chewy
- minitest
- rspec
- search
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
31 | 45 | | |
32 | 46 | | |
33 | 47 | | |
| |||
45 | 59 | | |
46 | 60 | | |
47 | 61 | | |
48 | | - | |
| 62 | + | |
49 | 63 | | |
50 | 64 | | |
51 | 65 | | |
| |||
65 | 79 | | |
66 | 80 | | |
67 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
68 | 85 | | |
69 | 86 | | |
70 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
3 | 15 | | |
4 | 16 | | |
5 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
220 | 221 | | |
221 | 222 | | |
222 | 223 | | |
223 | | - | |
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | 99 | | |
101 | 100 | | |
102 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
936 | 936 | | |
937 | 937 | | |
938 | 938 | | |
939 | | - | |
| 939 | + | |
940 | 940 | | |
941 | 941 | | |
942 | 942 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
133 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| |||
0 commit comments