Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Changes

* [#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][])
* [#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][])
* [#1014](https://github.com/toptal/chewy/pull/1014): Improve contributing documentation with development setup instructions, PR workflow, and grammar fixes. ([@mattmenefee][])

## 8.0.1 (2026-03-12)
Expand Down
10 changes: 7 additions & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,14 @@
# }
# )

# Low-level substitute for now-obsolete drop_indices
# Low-level substitute for now-obsolete drop_indices.
# Uses format: 'json' for version-portable parsing.
# System indices (prefixed with '.') are excluded to avoid deleting
# ES-internal indices like .security or .kibana.
def drop_indices
response = Chewy.client.cat.indices
indices = response.body.lines.map { |line| line.split[2] }
indices = Chewy.client.cat.indices(format: 'json')
.map { |entry| entry['index'] }
.reject { |name| name.start_with?('.') }
return if indices.blank?

Chewy.client.indices.delete(index: indices)
Expand Down