Changelog History
Page 4
-
v0.4.0 Changes
- Changed
update_index
matcher 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.template
DSL method for root objects dynamic templates definition. See [mapping.rb](lib/chewy/type/mapping.rb) for more details. - ActiveRecord adapter custom
primary_key
support ([@matthee][]). - Urgent update now clears association cache in ActiveRecord to ensure latest changes are imported.
import
now creates index before performing.Chewy.configuration[:wait_for_status]
option. Can be set tored
,yellow
orgreen
. If set - chewy will wait for cluster status before creating, deleting index and import. Useful for specs.
- Changed
-
v0.3.0 Changes
Added
Chewy.configuration[:index]
config to setup common indexes options.Chewy.client_options
replaced withChewy.configuration
Using source filtering instead of fields filter (http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-source-filtering.html).
-
v0.2.3 Changes
.import!
indexes method, raises import errors..import!
types method, raises import errors. Useful for specs.
-
v0.2.2 Changes
- Support for
none
scope ([@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'}}]} end
title_analyzer
here will be automatically resolved and passed to index mapping
- Support for
-
v0.2.0 Changes
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.import
now takes types hash as argument within options hash:PlacesIndex.import city: City.enabled, country: Country.enabled, refresh: false
Old indexes cleanup after reset.
Added index prefixes.
define_type
now takes options for adapter.chewy:reset
andchewy:reset:all
rake tasks are now trying to reset index with zero downtime if it is possible.Added
chewy:update:all
rake task.Methods
.create
,.create!
,.delete
,.delete
,reset!
are now supports index name suffix passing as the first argument. See [actions.rb](lib/chewy/index/actions.rb) for more details.Method
reset
renamed 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) })
-
v0.1.0 Changes
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)
-
v0.0.1 Changes
- Query DSL
- Basic index handling
- Initial version