Changelog
master (unreleased)
New Features
Changes
Bugs Fixed
7.0.1 (2021-05-03)
Changes
- #792: Skip ES version memoization for search requests (@rabotyaga)
- See the Migration Guide for details
7.0.0 (2021-02-22)
New Features
- #763: Added support for Elasticsearch 7 (@rabotyaga)
Changes
- #757: (Breaking) Fix
Chewy::Index.index&Chewy::Index.aliasesto correctly report indexes and aliases (@mpeychich, @dalthon) - #761: Avoid fetching scope data to check if it is blank (@dalthon)
6.0.0 (2021-02-11)
Changes
- #743: (Breaking) Elasticsearch 6.x support added. See the migration guide & ES breaking changes. Removed legacy DSL support. Removed support for ES < 5. (@mrzasa, @konalegi, @rabotyaga)
- #751: Add Multi Search API support. (@mpeychich, @dalthon)
- #755:
attribute_highlightsreturns an array of highlights. (@musaffa, @dalthon) - #753: Add support for direct_import parameter to skip objects reloading. (@TikiTDO, @dalthon)
- #739: Remove explicit
mainbranch dependencies onrspec-*gems afterrspec-mocks3.10.2 is released. (@rabotyaga)
Bugs Fixed
- #695: Clear the scroll by id after completing
scroll_batches. (@socialchorus) - #749: Avoid importing everything when given an empty relation. (@JF-Lalonde, @dalthon)
- #736: Fix nil children when using witchcraft. (@taylor-au)
5.2.0 (2021-01-28)
Changes
- #734: Add support for Ruby 3. (@lowang)
- #735: Correct deprecation warning for Elasticsearch 5.6 to 6: empty query for
_delete_by_query, delete by alias,index_already_exists_exceptionrenaming. (@bhacaz) - #733: Update gemspec dependencies for Rails. Update CI gemfiles and matrix to tests against current LTS Rails versions. (@bhacaz)
- Tweak some wording and formatting; add a note about compatibility; update copyright; remove broken logo; update the CI badge. (@bbatsov)
- #714: Update instructions for AWS ElasticSearch. (@olancheg)
- #728: Fix more ruby 2.7 keyword params deprecation warnings. (@aglushkov)
- #715: Fixed all deprecation warnings in Ruby 2.7. (@gseddon)
- #718: Added Ruby 2.7 to CircleCI config. (@mrzasa)
- #707: Allow configuration of Active Job queue name. (@mrzasa)
- #711: Setup CI on CircleCI. (@mrzasa)
- #710: Fix deprecation warning for constructing new
BigDecimal. (@AlexVPopov)
5.1.0 (2019-09-24)
Changes
- #657: (Breaking) Add support for multiple indices in request. (@pyromaniac)
- #647: (Breaking) Support
search_type,request_cache, andallow_partial_search_resultsas query string parameters. (@mattzollinhofer) - #606: Speed up imports when
bulk_sizeis specified. (@yahooguntu) - #682: Insert
RequestStrategymiddleware beforeActionDispatch::ShowExceptions. (@dck)
5.0.0 (2018-02-13)
Changes
- (Breaking) Align the gem version with the most recent ElasticSearch version we support.
- (Breaking)
Chewy.default_field_typeistextnow. - (Breaking)
Chewy::Stashwas split onto two indexes -Chewy::Stash::SpecificationandChewy::Stash::Journal. - (Breaking) Data for journal and specification is stored in binary fields base64-encoded to bypass the limits of other fields.
- (Breaking) #626: Don't underscore suggested index name. (@dm1try)
- #598:
pipelineimport option support. (@eManPrague) - #625: Proper Rails check. (@nattfodd)
- #623: Bypass strategy performance improvements. (@DNNX)
- #620: Avoid index update calls for empty data. (@robertasg)
- Do not underscore suggested index name on
Chewy::Index.index_namecall. - It is possible now to call
rootmethod several times inside a single type definition, the options will be merged. Also, the block isn't required anymore. - #565: Fixed some Sequel deprecation warnings. (@arturtr)
- #577: Fixed some Sequel deprecation warnings. (@matchbookmac)
Bugs Fixed
- #593: Fixed index settings logic error. (@yahooguntu)
- #567: Missed check in higlight method. (@heartfulbird)
0.10.1
Changes
- #558: Improved parallel worker titles
Bugs Fixed
- #557: Fixed request strategy initial debug message
- #556: Fixed will objects paginated array initialization when pagination was not used
- #555: Fixed fields symbol/string value
- #554: Fixed root field value proc
0.10.0
Breaking changes
- Changed behavior of
Chewy::Index.index_name, it doesn't cache the values anymore. - Journal interfaces, related code and rake tasks were completely refactored and are not compatible with the previous version.
Changes
- #543: Less noisy strategies logging (@Borzik)
- Parallel import and the corresponding rake tasks.
- #532:
:shoryukenasync strategy (@josephchoe) - Deprecate
Chewy::Index.build_index_name. - Rename
Chewy::Index.default_prefixtoChewy::Index.prefix. The old one is deprecated. - Add
Chewy::Type.derivable_namefor consistency. - Rename
Chewy::Index.derivable_index_nametoChewy::Index.derivable_name.Chewy::Index.derivable_index_nameandChewy::Type.derivable_index_nameare deprecated. - Use normal YAML loading, for the config, we don't need the safe one.
- #526:
default_root_optionsoption (@barthez) - Partial indexing ability: it is possible to update only specified fields.
- New cool
rake chewy:deploytask. - Selective reset (resets only if necessary):
rake chewy:upgrade. - Consistency checks and synchronization:
rake chewy:sync. - Brand new request DSL. Supports ElasticSearch 2 and 5, better usability, architecture and docs.
- Add Kaminari 1.0 support.
- #483:
skip_index_creation_on_importoption (@sergey-kintsel) - #481: Ability to use procs for settings (@parallel588)
- #467: Bulk indexing optimizations with new additional options (@eproulx-petalmd)
- #438: Configurable sidekiq options (@averell23)
0.9.0
Changes
- #443: Add
preferenceparam to Query (@menglewis) - #417: Add the
track_scoresoption to the query;_scoreto be computed and tracked even when there are no_scorein sort. (@dmitry) - #414, #433, #439: Confugurable
Chewy.indices_path(@robacarp) - #409, #425, #428, #432, #434, #463: Journaling implementation (@sergey-kintsel)
- #396: Minitest helpers (@robacarp)
- #393:
Chewy::Query#unlimitedto fetch all the documents (@sergey-kintsel) - #386:
Chewy::Query#exists?(@sergey-kintsel) - #381, #376: Import otimizations
- #375: Additional import optimization technique - raw import (@DNNX)
- #380:
weightscoring dunction was added to the search DSL (@sevab) - Rake tasks support multiple indexes and exceptions:
rake chewy:reset[users,projects],rake chewy:update[-projects] - Witchcraft™ supports dynamically generated procs with variables from closure.
- Added
Query#preferencefor specifying shard replicas to query against. (@menglewis)
Bugs Fixed
- #415:
.script_fieldsmethod in the Index class (@dmitry) - #398: Fix routing_missing_exception on delete with parent missing (@guigs)
- #385: Sequel custom primary keys handling fix (@okliv)
- #374: Bulk import fixes (@0x0badc0de)
0.8.4
Changes
- Brand new import
:bulk_sizeoption, set desired ElasticSearch bulk size in bytes - Witchcraft™ technology
- #341: Configurable per-type default import options (@barthez)
- Various codebase optimizations (@DNNX, @pyromaniac)
update_indexRspec matcher messages improvements:allrake tasks deprecation- #335: Scoped notification subscriptions in rake tasks (@0x0badc0de)
- #321: Async strategies workers accept options (@dnd)
- #314: Prefix is configurable per-index (@mikeyhogarth)
- #302, #339: Ability to pass proc for transport configuration (@feymartynov, @reidab)
- #297: ElasticSearch 2 support (@sergeygaychuk)
- Accessing types with methods is deprecated. Use
MyIndex::MyTypeconstant reference instead ofMyIndex.my_typemethod. - #294: Sequel adapter improvements (@mrbrdo)
Bugs Fixed
- #325: Mongoid atomic strategy fix
- #324: Method missing fix (@jesjos)
- #319: Hash fields composition fix (@eproulx-petalmd)
- #306: Better errors handling in strategies (@barthez)
- #303: Assets strategies silencer fix for Rails 5 API mode (@clupprich)
0.8.3
Breaking changes:
Chewy.atomicandChewy.urgent_update=methods was removed from the codebase, useChewy.strategyblock instead.delete_from_index?hook is removed from the codebase.
Changes
- Sequel support completely reworked to use common ORM implementations + better sequel specs covarage.
Bugs Fixed
- Sequel objects transactional destruction fix
- Correct Rspec mocking framework checking (@mainameiz)
- Atomic strategy is now compatible with custom ids proc.
- Safe unsubscribe on import ([@marshall-lee][])
- Correct custom assets path silencer (@davekaro)
0.8.2
Changes
- ActiveJob strategy by @mkcode
- Async strategies tweak (@AndreySavelyev)
- GeoPoint readme (@joonty)
- Multiple grammar fixes and code improvements (@biow0lf)
- Named aggregations by @caldwecr
- Sequel adapter by @jirutka
- Rake helper methods extracted (@caldwecr, @jirutka)
- Multiple grammar fixes (@henrebotha)
- Ability to pass a proc to
update_indexto define updating index dynamically (@SeTeM)
Bugs Fixed
- Fixed transport logger and tracer configuration
0.8.1
Bugs Fixed
- Added support of elasticsearch-ruby 1.0.10
0.8.0
Breaking changes:
:atomicand:urgentstrategies are usingimport!method raising exceptions
Changes
- Crutches™ technology
- Added
.script_fieldschainable method to query (@ka8725) update_indexmatcher mocha support (@lardawge):resqueasync strategy:sidekiqasync strategy (inspired by @sharkzp)- Added
Query#search_typeforsearch_typerequest option setup ([@marshall-lee][])
Bugs Fixed
- Rails 4.2 migrations are not raising UndefinedUpdateStrategy anymore on data updates
- Mongoid random failing specs fixes ([@marshall-lee][])
0.7.0
Breaking changes:
Chewy.use_after_commit_callbacks = falsereturns previous RDBMS behavior in tests- ActiveRecord import is now called after_commit instead of after_save and after_destroy
- Import now respects default scope and removes unmatched documents
delete_from_index?method is deprecated, useruby define_type User, delete_if: ->{ removed? } do ... endChewy.request_strategyto configure action controller's request wrapping strategyChewy.root_strategyto configure the first strategy in stack- Default strategy for controller actions is
:atomic - Default strategy for activerecord migrations is
:bypass - Default strategy for sandbox console is
:bypass - Default strategy for rails console is
:urgent Chewy.configurationwas renamed toChewy.settings- Reworked index update strategies implementation.
Chewy.atomicandChewy.urgent_updateare now deprecated in favour of the newChewy.strategyAPI. Loading objects for object-sourced types using
wrapmethod is deprecated,load_onemethod should be used instead. Or method name might be passed todefine_type:class GeoData def self.get_data(elasticsearch_document) REDIS.get("geo_data_#{elasticsearch_document.id}") end end ... define_type GeoData, load_one_method: :get_data do ... end
Changes
- Multiple enhancements by @DNNX
- Added
script_fieldsto search criteria (@ka8725) ORM adapters now completely relies on the default scope. This means every scope or objects passed to import are merged with default scope so basically there is no need to define
delete_ifblock. Default scope strongly restricts objects which may land in the current index.define_type Country.where("rating > 30") do end # this code would import only countries with rating between 30 and 50 CountriesIndex::Country.import(Country.where("rating < 50")) # the same is true for arrays of objects or ids CountriesIndex::Country.import(Country.where("rating < 50").to_a) CountriesIndex::Country.import(Country.where("rating < 50").pluck(:id))Object adapter supports custom initial import and load methods, so it could be configured to be used with procs or any class responding to
callmethod.class GeoData def self.call REDIS.get_all end end ... define_type GeoData do ... endNested fields value procs additional arguments: parent objects.
define_type Country do field :name field :cities do field :district, value: ->(city, country) { city.districts if country.main? } end endImplemented basic named scopes
Bugs Fixed
script_scoreallow options (@joeljunstrom)- Chewy indexes eaged loading fixes (@leemhenson)
Chewy::Index.import nilimports nothing instead of initial data
0.6.2
Changes
- document root id custom value option (@baronworks)
Bugs Fixed
- Removed decay function defaults (@Linuus)
- Correct config file handling in case of empty file
0.6.1
Changes
min_scorequery option support (@jshirley)Chewy::Query#findmethod for finding documents by id
0.6.0
Changes
- Mongoid support YaY! (@fabiotomio, @leemhenson)
urgent: trueoption forupdate_indexis deprecated and will be removed soon, useChewy.atomicinsteadtimeoutandtimed_outsupport (@MarkMurphy)- will_paginate support (@josecoelho)
Bugs Fixed
- All the query chainable methods delegated to indexes and types (partially @Linuus)
0.5.2
Breaking changes:
Chewy::Type::Baseremoved in favour of usingChewy::Typeas a base class for all types
Changes
Chewy.massacrealiased toChewy.delete_allmethod deletes all the indexes with current prefix
Bugs Fixed:
- Advanced type classes resolving (@inbeom)
importignores nil
0.5.1
Changes:
chewy.ymlRails generator (@jirikolarik)- Parent-child mappings feature support (@inbeom)
Chewy::Index.total_countandChewy::Type::Base.total_countChewy::Type::Base.resetmethod. Deletes all the type documents and performs import (@jondavidford)- Added
Chewy::Query#delete_allscope method using delete by query ES feature (@jondavidford) - Rspec 3
update_indexmatcher support (@jimmybaker) - Implemented function scoring (@averell23)
Bugs Fixed:
- Indexed eager-loading fix (@leemhenson)
- Field type deriving nested type support fix (@rschellhorn)
0.5.0
Breaking changes:
- 404 exception (IndexMissingException) while query is swallowed and treated like an empty result set.
loadandpreloadfor queries became lazy. Might be partially incompatible.- Changed mapping behavior: multi-fields are defined in conformity with ElasticSearch documentation (http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/_multi_fields.html#_multi_fields)
Changes:
suggestquery options support (@rschellhorn).- Added hash data support. How it is possible to pass hashes to import.
rake chewy:resetandrake chewy:updateparamless acts asrake chewy:reset:allandrake chewy:update:allrespectively- Added
delete_from_index?API method for custom deleted objects marking. - Added
post_filterAPI, working the same way as filters. - Added chainable
strategyquery method. - Aliasing is performed in index create request for ElasticSearch >= 1.1.
preloadscope method loads ORM/ODM objects in background.loadmethod:onlyand:exceptoptions to specify load types.highlightandrescorequery options support.- config/chewy.yml ERB support.
Bugs Fixed:
- Fixed
missingandexistsfilters DSL constructors. - Reworked index data composing.
- Support for Kaminari new PaginatableArray behavior (@leemhenson)
- Correct waiting for status. After index creation, bulk import, and deletion.
- #23: Fix "wrong constant name" with namespace models
0.4.0
- Changed
update_indexmatcher behavior. Now it compare array attributes position-independently. - Search aggregations API support (@arion).
- Chewy::Query#facets called without params performs the request and returns facets.
- Added
Type.templateDSL method for root objects dynamic templates definition. See mapping.rb for more details. - ActiveRecord adapter custom
primary_keysupport (@matthee). - Urgent update now clears association cache in ActiveRecord to ensure latest changes are imported.
importnow creates index before performing.Chewy.configuration[:wait_for_status]option. Can be set tored,yelloworgreen. If set - chewy will wait for cluster status before creating, deleting index and import. Useful for specs.
0.3.0
- Added
Chewy.configuration[:index]config to setup common indexes options. Chewy.client_optionsreplaced withChewy.configuration- Using source filtering instead of fields filter (http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-source-filtering.html).
0.2.3
.import!indexes method, raises import errors..import!types method, raises import errors. Useful for specs.
0.2.2
- Support for
nonescope (@undr). Auto-resolved analyzers and analyzers repository (@webgago):
# Setting up analyzers repository: Chewy.analyzer :title_analyzer, type: 'custom', filter: %w(lowercase icu_folding title_nysiis) Chewy.filter :title_nysiis, type: 'phonetic', encoder: 'nysiis', replace: false # Using analyzers from repository in index classes class ProductsIndex < Chewy::Index settings analysis: {analyzer: ['title_analyzer', {one_more_analyzer: {type: 'custom', tokenizer: 'lowercase'}}]} endtitle_analyzerhere will be automatically resolved and passed to index mapping
0.2.0
- Reworked import error handling. Now all the import errors from ElasticSearch are handled properly, also import method returns true of false depending on the import process success.
Chewy::Index.importnow takes types hash as argument within options hash:PlacesIndex.import city: City.enabled, country: Country.enabled, refresh: falseOld indexes cleanup after reset.
Added index prefixes.
define_typenow takes options for adapter.chewy:resetandchewy:reset:allrake tasks are now trying to reset index with zero downtime if it is possible.Added
chewy:update:allrake task.Methods
.create,.create!,.delete,.delete,reset!are now supports index name suffix passing as the first argument. See actions.rb for more details.Method
resetrenamed toreset!.Added common loading scope for AR adapter. Also removed scope proc argument, now it executes just in main load scope context.
CitiesIndex.all.load(scope: {city: City.include(:country)})CitiesIndex.all.load(scope: {city: -> { include(:country) }})CitiesIndex.all.load(scope: ->{ include(:country) })
0.1.0
- Added filters simplified DSL. See filters.rb for more details.
- Queries and filters join system reworked. See query.rb for more details.
- Added query
mergemethod update_indexmatcher now wraps expected block inChewy.atomicby default. This behaviour can be prevented withatomic: falseoption passingruby expect { user.save! }.to update_index('users#user', atomic: false)- Renamed
Chewy.observing_enabledtoChewy.urgent_updatewithfalseas default update_elasticsearchrenamed toupdate_index, addedupdate_index:urgentoption- Added import ActiveSupport::Notifications instrumentation
ActiveSupport::Notifications.subscribe('import_objects.chewy') { |*args| } - Added
types!andonly!query chain methods, which purges previously chained types and fields typeschain method now uses types filter- Added
typesquery chain method - Changed types access API:
ruby UsersIndex::User # => UsersIndex::User UsersIndex::types_hash['user'] # => UsersIndex::User UsersIndex.user # => UsersIndex::User UsersIndex.types # => [UsersIndex::User] UsersIndex.type_names # => ['user'] update_elasticsearchmethod name as the second argumentupdate_elasticsearch('users#user', :self) update_elasticsearch('users#user', :users)Changed index handle methods, removed
index_prefix. I.e. wasUsersIndex.index_create, becameUsersIndex.createAbility to pass value proc for source object context if arity == 0
field :full_name, value: ->{ first_name + last_name }instead offield :full_name, value: ->(u){ u.first_name + u.last_name }Added
.onlychain toupdate_indexmatcherAdded ability to pass ActiveRecord::Relation as a scope for load
CitiesIndex.all.load(scope: {city: City.include(:country)})Added method
allto index for query DSL consistencyImplemented isolated adapters to simplify adding new ORMs
Query DLS chainable methods delegated to index class (no longer need to call MyIndex.search.query, just MyIndex.query)
0.0.1
- Query DSL
- Basic index handling
- Initial version