chewy v0.1.0 Release Notes
-
Added filters simplified DSL. See [filters.rb](lib/chewy/query/filters.rb) for more details.
Queries and filters join system reworked. See [query.rb](lib/chewy/query.rb) for more details.
Added query
merge
methodupdate_index
matcher now wraps expected block inChewy.atomic
by default. This behaviour can be prevented withatomic: false
option passingexpect { user.save! }.to update_index('users#user', atomic: false)
Renamed
Chewy.observing_enabled
toChewy.urgent_update
withfalse
as defaultupdate_elasticsearch
renamed toupdate_index
, addedupdate_index
:urgent
optionAdded import ActiveSupport::Notifications instrumentation
ActiveSupport::Notifications.subscribe('import_objects.chewy') { |*args| }
Added
types!
andonly!
query chain methods, which purges previously chained types and fieldstypes
chain method now uses types filterAdded
types
query chain methodChanged types access API:
UsersIndex::User # => UsersIndex::User UsersIndex::types_hash['user'] # => UsersIndex::User UsersIndex.user # => UsersIndex::User UsersIndex.types # => [UsersIndex::User] UsersIndex.type_names # => ['user']
update_elasticsearch
method 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.create
Ability 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
.only
chain toupdate_index
matcherAdded ability to pass ActiveRecord::Relation as a scope for load
CitiesIndex.all.load(scope: {city: City.include(:country)})
Added method
all
to 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)