Remove obsolete _type field references#1028
Merged
Merged
Conversation
mattmenefee
force-pushed
the
remove-type-field
branch
from
June 1, 2026 22:46
8b4c88c to
a9a9d91
Compare
Elasticsearch removed the `_type` field from search responses in 8.0 (ES 7 already returned only the placeholder `_doc`), so Chewy's lingering `_type` references no longer matched real responses. The mock response helpers in particular produced fixtures that did not reflect what ES actually returns, which could mislead users writing assertions against them. This removes `_type` from: - `Chewy::Minitest::Helpers` and `Chewy::Rspec::Helpers` mock responses - `Chewy::Search::Request::EVERFIELDS` (also drops the long-obsolete `_parent` entry) and the `pluck` documentation - `Chewy::Index::Wrapper` generated accessors - the README response example and associated specs It also documents the mock-helper assertion change in the Chewy 7 / ES 7 to Chewy 8 / ES 8 migration guide section. This is a behavioral no-op against ES 8+/9 clusters (none return `_type`); it simply aligns the code and test fixtures with actual Elasticsearch responses.
mattmenefee
force-pushed
the
remove-type-field
branch
from
June 1, 2026 22:56
a9a9d91 to
4c5eca7
Compare
4 tasks
AlfonsoUceda
approved these changes
Jun 2, 2026
Contributor
|
Thanks @mattmenefee |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_typefield from Chewy. Elasticsearch removed_typefrom search responses in 8.0 (ES 7 already returned only the placeholder_doc), so these references no longer matched real ES responses._typewas still present in mock response helpers (Chewy::Minitest::Helpers,Chewy::Rspec::Helpers), so the fixtures they produced were misleading for anyone writing assertions against them.Chewy::Search::Request::EVERFIELDS(along with the long-obsolete_parententry), thepluckdocumentation,Chewy::Index::Wrappergenerated accessors, and the README response example._typeactually disappeared from responses)._type); this only aligns the code and test fixtures with what Elasticsearch actually returns.Test plan
bundle exec rspec spec/chewy/rspec/helpers_spec.rb spec/chewy/minitest/helpers_spec.rb spec/chewy/search/response_spec.rb spec/chewy/index/wrapper_spec.rb(69 examples, 0 failures)bundle exec rspec spec/chewy/search/request_spec.rb -e pluck(5 examples, 0 failures — exercises theEVERFIELDSpath)