-
Chewy.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.
-
Object adapter initial proc support. Used for initial index filling.
define_type ->{ ObjectsSource.new }, name: :custom_objects do ... end
-
Nested fields value procs additional arguments: parent objects.
define_type Country do field :name field :cities do filed :district, value: ->(city, country) { city.districts if country.main? } end end
-
Implemented basic names scopes
- document root id custom value option (@baronworks)
-
Removed decay function defaults (@Linuus)
-
Correct config file handling in case of empty file
-
min_scorequery option support (@jshirley) -
Chewy::Query#findmethod for finding records by id
-
Mongoid support YaY! (@fabiotomio, @leemhenson)
-
urgent: trueoption forupdate_indexis deprecated and will be removed soon, useChewy.atomicinstead -
timeoutandtimed_outsupport (@MarkMurphy) -
will_paginate support (@josecoelho)
- All the query chainable methods delegated to indexes and types (partially @Linuus)
Chewy::Type::Baseremoved in favour of usingChewy::Typeas a base class for all types
Chewy.massacrealiased toChewy.delete_allmethod deletes all the indexes with current prefix
-
Advanced type classes resolving (@inbeom)
-
importignores nil
-
chewy.ymlRails generator (@jirikolarik) -
Parent-child mappings feature support (@inbeom)
-
Chewy::Index.total_countandChewy::Type::Base.total_count -
Chewy::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)
-
Indexed eager-loading fix (@leemhenson)
-
Field type deriving nested type support fix (@rschellhorn)
-
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)
-
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.
-
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.
-
Fix #23 "wrong constant name" with namespace models
-
Changed
update_indexmatcher behavior. Now it compare array attributes position-independantly. -
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.
-
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).
-
.import!indexes method, raises import errors. -
.import!types method, raises import errors. Useful for specs.
-
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'}}]} end
title_analyzerhere will be automatically resolved and passed to index mapping
-
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: false -
Old 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) })
-
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 passingexpect { 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:
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.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
.onlychain toupdate_indexmatcher -
Added 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 consistency -
Implemented 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)
-
Query dsl
-
Basic index hadling
-
Initial version