chewy 7.3.6 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +2 -28
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +10 -0
- data/Gemfile +4 -4
- data/README.md +1 -1
- data/chewy.gemspec +3 -17
- data/gemfiles/base.gemfile +12 -0
- data/gemfiles/rails.6.1.activerecord.gemfile +2 -1
- data/gemfiles/rails.7.0.activerecord.gemfile +2 -1
- data/gemfiles/rails.7.1.activerecord.gemfile +2 -1
- data/lib/chewy/config.rb +12 -10
- data/lib/chewy/fields/root.rb +1 -1
- data/lib/chewy/index/adapter/active_record.rb +1 -1
- data/lib/chewy/index/adapter/object.rb +3 -3
- data/lib/chewy/index/adapter/orm.rb +2 -2
- data/lib/chewy/index/import/bulk_builder.rb +2 -2
- data/lib/chewy/index/import.rb +2 -2
- data/lib/chewy/index/observe/active_record_methods.rb +1 -1
- data/lib/chewy/index/syncer.rb +1 -1
- data/lib/chewy/minitest/search_index_receiver.rb +3 -1
- data/lib/chewy/rake_helper.rb +3 -3
- data/lib/chewy/rspec/update_index.rb +3 -3
- data/lib/chewy/runtime/version.rb +1 -1
- data/lib/chewy/search/parameters/indices.rb +1 -1
- data/lib/chewy/search/parameters/storage.rb +1 -1
- data/lib/chewy/search/parameters.rb +3 -3
- data/lib/chewy/search.rb +6 -4
- data/lib/chewy/version.rb +1 -1
- data/lib/chewy.rb +1 -1
- data/spec/chewy/index/actions_spec.rb +4 -4
- data/spec/chewy/index/import/bulk_builder_spec.rb +3 -3
- data/spec/chewy/index/import_spec.rb +3 -3
- data/spec/chewy/minitest/helpers_spec.rb +1 -1
- data/spec/chewy/minitest/search_index_receiver_spec.rb +6 -4
- data/spec/chewy/rake_helper_spec.rb +4 -4
- data/spec/chewy/rspec/helpers_spec.rb +1 -1
- data/spec/chewy/search/pagination/kaminari_examples.rb +1 -1
- data/spec/chewy/search/pagination/kaminari_spec.rb +1 -1
- data/spec/chewy/strategy/active_job_spec.rb +8 -8
- data/spec/chewy/strategy/lazy_sidekiq_spec.rb +10 -10
- data/spec/chewy/strategy/sidekiq_spec.rb +4 -4
- data/spec/chewy_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +5 -268
- data/gemfiles/rails.5.2.activerecord.gemfile +0 -11
- data/gemfiles/rails.6.0.activerecord.gemfile +0 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a5afbccc50c9249e0a78e4f2383cef346360cef2fe9f1015d05972f4df31c26f
|
|
4
|
+
data.tar.gz: 3f0238841652782eff513dfdaa4916e8151469db5749e95e661f9c0236c526f1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e46394c42fc5cadabd70e5917a795bc071667c4bdf69a2b0d1d1a53c1db547a9b3221839ca8463c738030192bf135998a2de5c3652c87b6523cd08f7e69d80ad
|
|
7
|
+
data.tar.gz: 0bbf17766315cd0bf21bd9ec5e402584212515094cd086a003c08e23594083e2ac5b44758f27b1750b82f284260c0eb8e4cb8d12e32357cf770efc917da6595e
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -11,39 +11,13 @@ on:
|
|
|
11
11
|
]
|
|
12
12
|
|
|
13
13
|
jobs:
|
|
14
|
-
ruby-2:
|
|
15
|
-
runs-on: ubuntu-latest
|
|
16
|
-
strategy:
|
|
17
|
-
fail-fast: false
|
|
18
|
-
matrix:
|
|
19
|
-
ruby: [2.6, 2.7]
|
|
20
|
-
gemfile: [rails.5.2.activerecord, rails.6.0.activerecord, rails.6.1.activerecord]
|
|
21
|
-
name: ${{ matrix.ruby }}-${{ matrix.gemfile }}
|
|
22
|
-
|
|
23
|
-
env:
|
|
24
|
-
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
|
|
25
|
-
|
|
26
|
-
steps:
|
|
27
|
-
- uses: actions/checkout@v4
|
|
28
|
-
- uses: ruby/setup-ruby@v1
|
|
29
|
-
with:
|
|
30
|
-
ruby-version: ${{ matrix.ruby }}
|
|
31
|
-
bundler-cache: true
|
|
32
|
-
- name: Run Elasticsearch
|
|
33
|
-
uses: elastic/elastic-github-actions/elasticsearch@9de0f78f306e4ebc0838f057e6b754364685e759
|
|
34
|
-
with:
|
|
35
|
-
stack-version: 7.10.1
|
|
36
|
-
port: 9250
|
|
37
|
-
- name: Tests
|
|
38
|
-
run: bundle exec rspec
|
|
39
|
-
|
|
40
14
|
ruby-3:
|
|
41
15
|
runs-on: ubuntu-latest
|
|
42
16
|
strategy:
|
|
43
17
|
fail-fast: false
|
|
44
18
|
matrix:
|
|
45
19
|
ruby: [ '3.0', '3.1', '3.2' ]
|
|
46
|
-
gemfile: [
|
|
20
|
+
gemfile: [rails.6.1.activerecord, rails.7.0.activerecord, rails.7.1.activerecord]
|
|
47
21
|
name: ${{ matrix.ruby }}-${{ matrix.gemfile }}
|
|
48
22
|
|
|
49
23
|
env:
|
|
@@ -69,6 +43,6 @@ jobs:
|
|
|
69
43
|
- uses: actions/checkout@v4
|
|
70
44
|
- uses: ruby/setup-ruby@v1
|
|
71
45
|
with:
|
|
72
|
-
ruby-version:
|
|
46
|
+
ruby-version: 3.0
|
|
73
47
|
bundler-cache: true
|
|
74
48
|
- run: bundle exec rubocop --format simple
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,16 @@
|
|
|
8
8
|
|
|
9
9
|
### Bugs Fixed
|
|
10
10
|
|
|
11
|
+
## 7.4.0 (2023-12-13)
|
|
12
|
+
|
|
13
|
+
### New Features
|
|
14
|
+
|
|
15
|
+
### Changes
|
|
16
|
+
|
|
17
|
+
* [#911](https://github.com/toptal/chewy/pull/911): Remove ruby 2.x. ([@konalegi][https://github.com/konalegi])
|
|
18
|
+
|
|
19
|
+
### Bugs Fixed
|
|
20
|
+
|
|
11
21
|
## 7.3.5 (2023-12-13)
|
|
12
22
|
|
|
13
23
|
### New Features
|
data/Gemfile
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
source 'https://rubygems.org'
|
|
2
2
|
|
|
3
|
-
gemspec
|
|
4
|
-
|
|
5
3
|
gem 'activerecord'
|
|
6
4
|
|
|
7
5
|
gem 'activejob', require: false
|
|
@@ -18,5 +16,7 @@ gem 'guard-rspec'
|
|
|
18
16
|
gem 'redcarpet'
|
|
19
17
|
gem 'yard'
|
|
20
18
|
|
|
21
|
-
gem 'rexml'
|
|
22
|
-
|
|
19
|
+
gem 'rexml'
|
|
20
|
+
|
|
21
|
+
eval_gemfile 'gemfiles/base.gemfile'
|
|
22
|
+
gemspec
|
data/README.md
CHANGED
data/chewy.gemspec
CHANGED
|
@@ -2,7 +2,7 @@ lib = File.expand_path('lib', __dir__)
|
|
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
require 'chewy/version'
|
|
4
4
|
|
|
5
|
-
Gem::Specification.new do |spec|
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = 'chewy'
|
|
7
7
|
spec.version = Chewy::VERSION
|
|
8
8
|
spec.authors = ['Toptal, LLC', 'pyromaniac']
|
|
@@ -14,24 +14,10 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
|
|
|
14
14
|
|
|
15
15
|
spec.files = `git ls-files`.split($RS)
|
|
16
16
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
17
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
18
17
|
spec.require_paths = ['lib']
|
|
19
18
|
|
|
20
|
-
spec.
|
|
21
|
-
spec.add_development_dependency 'elasticsearch-extensions'
|
|
22
|
-
spec.add_development_dependency 'mock_redis'
|
|
23
|
-
spec.add_development_dependency 'rake'
|
|
24
|
-
spec.add_development_dependency 'rspec', '>= 3.7.0'
|
|
25
|
-
spec.add_development_dependency 'rspec-collection_matchers'
|
|
26
|
-
spec.add_development_dependency 'rspec-its'
|
|
27
|
-
spec.add_development_dependency 'rubocop', '1.11'
|
|
28
|
-
spec.add_development_dependency 'sqlite3'
|
|
29
|
-
spec.add_development_dependency 'timecop'
|
|
30
|
-
|
|
31
|
-
spec.add_development_dependency 'method_source'
|
|
32
|
-
spec.add_development_dependency 'unparser'
|
|
33
|
-
|
|
34
|
-
spec.add_dependency 'activesupport', '>= 5.2'
|
|
19
|
+
spec.add_dependency 'activesupport', '>= 5.2' # Remove with major version bump, 8.x
|
|
35
20
|
spec.add_dependency 'elasticsearch', '>= 7.12.0', '< 7.14.0'
|
|
36
21
|
spec.add_dependency 'elasticsearch-dsl'
|
|
22
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
37
23
|
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
gem 'database_cleaner'
|
|
2
|
+
gem 'elasticsearch-extensions'
|
|
3
|
+
gem 'method_source'
|
|
4
|
+
gem 'mock_redis'
|
|
5
|
+
gem 'rake'
|
|
6
|
+
gem 'rspec', '>= 3.7.0'
|
|
7
|
+
gem 'rspec-collection_matchers'
|
|
8
|
+
gem 'rspec-its'
|
|
9
|
+
gem 'rubocop', '1.48'
|
|
10
|
+
gem 'sqlite3'
|
|
11
|
+
gem 'timecop'
|
|
12
|
+
gem 'unparser'
|
data/lib/chewy/config.rb
CHANGED
|
@@ -127,17 +127,19 @@ module Chewy
|
|
|
127
127
|
private
|
|
128
128
|
|
|
129
129
|
def yaml_settings
|
|
130
|
-
@yaml_settings ||=
|
|
131
|
-
|
|
132
|
-
file = Rails.root.join('config', 'chewy.yml')
|
|
130
|
+
@yaml_settings ||= build_yaml_settings || {}
|
|
131
|
+
end
|
|
133
132
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
133
|
+
def build_yaml_settings
|
|
134
|
+
return unless defined?(Rails::VERSION)
|
|
135
|
+
|
|
136
|
+
file = Rails.root.join('config', 'chewy.yml')
|
|
137
|
+
|
|
138
|
+
return unless File.exist?(file)
|
|
139
|
+
|
|
140
|
+
yaml = ERB.new(File.read(file)).result
|
|
141
|
+
hash = YAML.unsafe_load(yaml)
|
|
142
|
+
hash[Rails.env].try(:deep_symbolize_keys) if hash
|
|
141
143
|
end
|
|
142
144
|
|
|
143
145
|
def build_search_class(base)
|
data/lib/chewy/fields/root.rb
CHANGED
|
@@ -6,7 +6,7 @@ module Chewy
|
|
|
6
6
|
class ActiveRecord < Orm
|
|
7
7
|
def self.accepts?(target)
|
|
8
8
|
defined?(::ActiveRecord::Base) && (
|
|
9
|
-
target.is_a?(Class) && target < ::ActiveRecord::Base ||
|
|
9
|
+
(target.is_a?(Class) && target < ::ActiveRecord::Base) ||
|
|
10
10
|
target.is_a?(::ActiveRecord::Relation))
|
|
11
11
|
end
|
|
12
12
|
|
|
@@ -85,7 +85,7 @@ module Chewy
|
|
|
85
85
|
# @param args [Array<#to_json>]
|
|
86
86
|
# @option options [Integer] :batch_size import processing batch size
|
|
87
87
|
# @return [true, false]
|
|
88
|
-
|
|
88
|
+
def import(*args, &block)
|
|
89
89
|
collection, options = import_args(*args)
|
|
90
90
|
import_objects(collection, options, &block)
|
|
91
91
|
end
|
|
@@ -113,7 +113,7 @@ module Chewy
|
|
|
113
113
|
# end
|
|
114
114
|
#
|
|
115
115
|
# @see Chewy::Index::Adapter::Base#import_fields
|
|
116
|
-
|
|
116
|
+
def import_fields(*args, &block)
|
|
117
117
|
return enum_for(:import_fields, *args) unless block_given?
|
|
118
118
|
|
|
119
119
|
options = args.extract_options!
|
|
@@ -139,7 +139,7 @@ module Chewy
|
|
|
139
139
|
# For the Object adapter returns the objects themselves in batches.
|
|
140
140
|
#
|
|
141
141
|
# @see Chewy::Index::Adapter::Base#import_references
|
|
142
|
-
|
|
142
|
+
def import_references(*args, &block)
|
|
143
143
|
return enum_for(:import_references, *args) unless block_given?
|
|
144
144
|
|
|
145
145
|
collection, options = import_args(*args)
|
|
@@ -72,7 +72,7 @@ module Chewy
|
|
|
72
72
|
# # or
|
|
73
73
|
# UsersIndex.import users.map(&:id) # user ids will be deleted from index
|
|
74
74
|
#
|
|
75
|
-
|
|
75
|
+
def import(*args, &block)
|
|
76
76
|
collection, options = import_args(*args)
|
|
77
77
|
|
|
78
78
|
if !collection.is_a?(relation_class) || options[:direct_import]
|
|
@@ -82,7 +82,7 @@ module Chewy
|
|
|
82
82
|
end
|
|
83
83
|
end
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
def import_fields(*args, &block)
|
|
86
86
|
return enum_for(:import_fields, *args) unless block_given?
|
|
87
87
|
|
|
88
88
|
collection, options = import_args(*args)
|
|
@@ -162,12 +162,12 @@ module Chewy
|
|
|
162
162
|
.filter(ids: {values: ids_for_cache})
|
|
163
163
|
.order('_doc')
|
|
164
164
|
.pluck(:_id, :_routing, join_field)
|
|
165
|
-
.
|
|
165
|
+
.to_h do |id, routing, join|
|
|
166
166
|
[
|
|
167
167
|
id,
|
|
168
168
|
{routing: routing, parent_id: join['parent']}
|
|
169
169
|
]
|
|
170
|
-
end
|
|
170
|
+
end
|
|
171
171
|
end
|
|
172
172
|
|
|
173
173
|
def existing_routing(id)
|
data/lib/chewy/index/import.rb
CHANGED
|
@@ -72,7 +72,7 @@ module Chewy
|
|
|
72
72
|
# @option options [true, false] update_failover enables full objects reimport in cases of partial update errors, `true` by default
|
|
73
73
|
# @option options [true, Integer, Hash] parallel enables parallel import processing with the Parallel gem, accepts the number of workers or any Parallel gem acceptable options
|
|
74
74
|
# @return [true, false] false in case of errors
|
|
75
|
-
|
|
75
|
+
def import(*args)
|
|
76
76
|
intercept_import_using_strategy(*args).blank?
|
|
77
77
|
end
|
|
78
78
|
|
|
@@ -83,7 +83,7 @@ module Chewy
|
|
|
83
83
|
# in case of any import errors.
|
|
84
84
|
#
|
|
85
85
|
# @raise [Chewy::ImportFailed] in case of errors
|
|
86
|
-
|
|
86
|
+
def import!(*args)
|
|
87
87
|
errors = intercept_import_using_strategy(*args)
|
|
88
88
|
|
|
89
89
|
raise Chewy::ImportFailed.new(self, errors) if errors.present?
|
|
@@ -71,7 +71,7 @@ module Chewy
|
|
|
71
71
|
end
|
|
72
72
|
end
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
def update_index(type_name, *args, &block)
|
|
75
75
|
callback_options = Observe.extract_callback_options!(args)
|
|
76
76
|
update_proc = Observe.update_proc(type_name, *args, &block)
|
|
77
77
|
callback = Chewy::Index::Observe::Callback.new(update_proc, callback_options)
|
data/lib/chewy/index/syncer.rb
CHANGED
|
@@ -27,7 +27,7 @@ module Chewy
|
|
|
27
27
|
# @see Chewy::Index::Actions::ClassMethods#sync
|
|
28
28
|
class Syncer
|
|
29
29
|
DEFAULT_SYNC_BATCH_SIZE = 20_000
|
|
30
|
-
ISO_DATETIME = /\A(\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)(\.\d+)?\z
|
|
30
|
+
ISO_DATETIME = /\A(\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)(\.\d+)?\z/
|
|
31
31
|
OUTDATED_IDS_WORKER = lambda do |outdated_sync_field_type, source_data_hash, index, total, index_data|
|
|
32
32
|
::Process.setproctitle("chewy [#{index}]: sync outdated calculation (#{::Parallel.worker_number + 1}/#{total})") if index
|
|
33
33
|
index_data.each_with_object([]) do |(id, index_sync_value), result|
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
# The class will capture the data from the *param on the Chewy::Index.bulk method and
|
|
7
7
|
# aggregate the data for test analysis.
|
|
8
8
|
class SearchIndexReceiver
|
|
9
|
+
MUTATION_FOR_CLASS = Struct.new(:indexes, :deletes, keyword_init: true)
|
|
10
|
+
|
|
9
11
|
def initialize
|
|
10
12
|
@mutations = {}
|
|
11
13
|
end
|
|
@@ -71,6 +73,6 @@ private
|
|
|
71
73
|
# @param index [Chewy::Index] the index to fetch.
|
|
72
74
|
# @return [#indexes, #deletes] an object with a list of indexes and a list of deletes.
|
|
73
75
|
def mutation_for(index)
|
|
74
|
-
@mutations[index] ||=
|
|
76
|
+
@mutations[index] ||= MUTATION_FOR_CLASS.new(indexes: [], deletes: [])
|
|
75
77
|
end
|
|
76
78
|
end
|
data/lib/chewy/rake_helper.rb
CHANGED
|
@@ -347,9 +347,9 @@ module Chewy
|
|
|
347
347
|
return if journal_exists?
|
|
348
348
|
|
|
349
349
|
output.puts "############################################################\n" \
|
|
350
|
-
"WARN: You are risking to lose some changes during the reset.\n" \
|
|
351
|
-
"
|
|
352
|
-
"
|
|
350
|
+
"WARN: You are risking to lose some changes during the reset.\n " \
|
|
351
|
+
"Please consider enabling journaling.\n " \
|
|
352
|
+
"See https://github.com/toptal/chewy#journaling\n" \
|
|
353
353
|
'############################################################'
|
|
354
354
|
end
|
|
355
355
|
|
|
@@ -108,7 +108,7 @@ RSpec::Matchers.define :update_index do |index_name, options = {}| # rubocop:dis
|
|
|
108
108
|
params_matcher = @no_refresh ? has_entry(refresh: false) : any_parameters
|
|
109
109
|
Chewy::Index::Import::BulkRequest.stubs(:new).with(index, params_matcher).returns(mock_bulk_request)
|
|
110
110
|
else
|
|
111
|
-
mocked_already =
|
|
111
|
+
mocked_already = RSpec::Mocks.space.proxy_for(Chewy::Index::Import::BulkRequest).method_double_if_exists_for_message(:new)
|
|
112
112
|
allow(Chewy::Index::Import::BulkRequest).to receive(:new).and_call_original unless mocked_already
|
|
113
113
|
params_matcher = @no_refresh ? hash_including(refresh: false) : any_args
|
|
114
114
|
allow(Chewy::Index::Import::BulkRequest).to receive(:new).with(index, params_matcher).and_return(mock_bulk_request)
|
|
@@ -220,7 +220,7 @@ RSpec::Matchers.define :update_index do |index_name, options = {}| # rubocop:dis
|
|
|
220
220
|
expected_count = options[:times] || options[:count]
|
|
221
221
|
expected_attributes = (options[:with] || options[:attributes] || {}).deep_symbolize_keys
|
|
222
222
|
|
|
223
|
-
args.flatten.
|
|
223
|
+
args.flatten.to_h do |document|
|
|
224
224
|
id = document.respond_to?(:id) ? document.id.to_s : document.to_s
|
|
225
225
|
[id, {
|
|
226
226
|
document: document,
|
|
@@ -229,7 +229,7 @@ RSpec::Matchers.define :update_index do |index_name, options = {}| # rubocop:dis
|
|
|
229
229
|
real_count: 0,
|
|
230
230
|
real_attributes: {}
|
|
231
231
|
}]
|
|
232
|
-
end
|
|
232
|
+
end
|
|
233
233
|
end
|
|
234
234
|
|
|
235
235
|
def compare_attributes(expected, real)
|
|
@@ -5,7 +5,7 @@ module Chewy
|
|
|
5
5
|
attr_reader :major, :minor, :patch
|
|
6
6
|
|
|
7
7
|
def initialize(version)
|
|
8
|
-
@major, @minor, @patch = *(version.to_s.split('.', 3) + [0] * 3).first(3).map(&:to_i)
|
|
8
|
+
@major, @minor, @patch = *(version.to_s.split('.', 3) + ([0] * 3)).first(3).map(&:to_i)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def to_s
|
|
@@ -17,7 +17,7 @@ module Chewy
|
|
|
17
17
|
# @param other [Chewy::Search::Parameters::Storage] any storage instance
|
|
18
18
|
# @return [true, false] the result of comparison
|
|
19
19
|
def ==(other)
|
|
20
|
-
super || other.class == self.class && other.render == render
|
|
20
|
+
super || (other.class == self.class && other.render == render)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
# Just adds indices to indices.
|
|
@@ -35,7 +35,7 @@ module Chewy
|
|
|
35
35
|
# @param other [Chewy::Search::Parameters::Storage] any storage instance
|
|
36
36
|
# @return [true, false] the result of comparision
|
|
37
37
|
def ==(other)
|
|
38
|
-
super || other.class == self.class && other.value == value
|
|
38
|
+
super || (other.class == self.class && other.value == value)
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
# Replaces current value with normalized provided one. Doesn't
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
Dir.glob(File.join(File.dirname(__FILE__), 'parameters', 'concerns', '*.rb')).
|
|
2
|
-
Dir.glob(File.join(File.dirname(__FILE__), 'parameters', '*.rb')).
|
|
1
|
+
Dir.glob(File.join(File.dirname(__FILE__), 'parameters', 'concerns', '*.rb')).each { |f| require f }
|
|
2
|
+
Dir.glob(File.join(File.dirname(__FILE__), 'parameters', '*.rb')).each { |f| require f }
|
|
3
3
|
|
|
4
4
|
module Chewy
|
|
5
5
|
module Search
|
|
@@ -53,7 +53,7 @@ module Chewy
|
|
|
53
53
|
# @param other [Object] any object
|
|
54
54
|
# @return [true, false]
|
|
55
55
|
def ==(other)
|
|
56
|
-
super || other.is_a?(self.class) && compare_storages(other)
|
|
56
|
+
super || (other.is_a?(self.class) && compare_storages(other))
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
# Clones the specified storage, performs the operation
|
data/lib/chewy/search.rb
CHANGED
|
@@ -56,7 +56,7 @@ module Chewy
|
|
|
56
56
|
#
|
|
57
57
|
# @example
|
|
58
58
|
# PlacesIndex.query(match: {name: 'Moscow'})
|
|
59
|
-
|
|
59
|
+
def method_missing(name, *args, &block)
|
|
60
60
|
if search_class::DELEGATED_METHODS.include?(name)
|
|
61
61
|
all.send(name, *args, &block)
|
|
62
62
|
else
|
|
@@ -84,10 +84,12 @@ module Chewy
|
|
|
84
84
|
def delegate_scoped(source, destination, methods)
|
|
85
85
|
methods.each do |method|
|
|
86
86
|
destination.class_eval do
|
|
87
|
-
define_method method do |*args, &block|
|
|
88
|
-
scoping
|
|
87
|
+
define_method method do |*args, **kwargs, &block|
|
|
88
|
+
scoping do
|
|
89
|
+
source.public_send(method, *args, **kwargs, &block)
|
|
90
|
+
end
|
|
89
91
|
end
|
|
90
|
-
|
|
92
|
+
method
|
|
91
93
|
end
|
|
92
94
|
end
|
|
93
95
|
end
|
data/lib/chewy/version.rb
CHANGED
data/lib/chewy.rb
CHANGED
|
@@ -48,7 +48,7 @@ require 'chewy/index'
|
|
|
48
48
|
require 'chewy/fields/base'
|
|
49
49
|
require 'chewy/fields/root'
|
|
50
50
|
require 'chewy/journal'
|
|
51
|
-
require 'chewy/railtie' if defined?(
|
|
51
|
+
require 'chewy/railtie' if defined?(Rails::Railtie)
|
|
52
52
|
|
|
53
53
|
ActiveSupport.on_load(:active_record) do
|
|
54
54
|
include Chewy::Index::Observe::ActiveRecordMethods
|
|
@@ -610,7 +610,7 @@ describe Chewy::Index::Actions do
|
|
|
610
610
|
specify 'with journal application' do
|
|
611
611
|
cities
|
|
612
612
|
p 'cities created1'
|
|
613
|
-
|
|
613
|
+
ActiveRecord::Base.connection.close if defined?(ActiveRecord::Base)
|
|
614
614
|
[
|
|
615
615
|
parallel_update,
|
|
616
616
|
Thread.new do
|
|
@@ -619,7 +619,7 @@ describe Chewy::Index::Actions do
|
|
|
619
619
|
p 'end reset1'
|
|
620
620
|
end
|
|
621
621
|
].map(&:join)
|
|
622
|
-
|
|
622
|
+
ActiveRecord::Base.connection.reconnect! if defined?(ActiveRecord::Base)
|
|
623
623
|
p 'expect1'
|
|
624
624
|
expect(CitiesIndex::City.pluck(:_id, :name)).to contain_exactly(%w[1 NewName1], %w[2 Name2], %w[3 NewName3])
|
|
625
625
|
p 'end expect1'
|
|
@@ -628,7 +628,7 @@ describe Chewy::Index::Actions do
|
|
|
628
628
|
specify 'without journal application' do
|
|
629
629
|
cities
|
|
630
630
|
p 'cities created2'
|
|
631
|
-
|
|
631
|
+
ActiveRecord::Base.connection.close if defined?(ActiveRecord::Base)
|
|
632
632
|
[
|
|
633
633
|
parallel_update,
|
|
634
634
|
Thread.new do
|
|
@@ -637,7 +637,7 @@ describe Chewy::Index::Actions do
|
|
|
637
637
|
p 'end reset2'
|
|
638
638
|
end
|
|
639
639
|
].map(&:join)
|
|
640
|
-
|
|
640
|
+
ActiveRecord::Base.connection.reconnect! if defined?(ActiveRecord::Base)
|
|
641
641
|
p 'expect2'
|
|
642
642
|
expect(CitiesIndex::City.pluck(:_id, :name)).to contain_exactly(%w[1 Name1], %w[2 Name2], %w[3 Name3])
|
|
643
643
|
p 'end expect2'
|
|
@@ -132,7 +132,7 @@ describe Chewy::Index::Import::BulkBuilder do
|
|
|
132
132
|
before do
|
|
133
133
|
stub_index(:cities) do
|
|
134
134
|
crutch :names do |collection|
|
|
135
|
-
collection.
|
|
135
|
+
collection.to_h { |item| [item.id, "Name#{item.id}"] }
|
|
136
136
|
end
|
|
137
137
|
|
|
138
138
|
field :name, value: ->(o, c) { c.names[o.id] }
|
|
@@ -198,7 +198,7 @@ describe Chewy::Index::Import::BulkBuilder do
|
|
|
198
198
|
index_scope Comment
|
|
199
199
|
|
|
200
200
|
crutch :content_with_crutches do |collection| # collection here is a current batch of products
|
|
201
|
-
collection.
|
|
201
|
+
collection.to_h { |comment| [comment.id, "[crutches] #{comment.content}"] }
|
|
202
202
|
end
|
|
203
203
|
|
|
204
204
|
field :content
|
|
@@ -272,7 +272,7 @@ describe Chewy::Index::Import::BulkBuilder do
|
|
|
272
272
|
default_import_options raw_import: ->(hash) { SimpleComment.new(hash) }
|
|
273
273
|
|
|
274
274
|
crutch :content_with_crutches do |collection| # collection here is a current batch of products
|
|
275
|
-
collection.
|
|
275
|
+
collection.to_h { |comment| [comment.id, "[crutches] #{comment.content}"] }
|
|
276
276
|
end
|
|
277
277
|
|
|
278
278
|
field :content
|
|
@@ -215,8 +215,8 @@ describe Chewy::Index::Import do
|
|
|
215
215
|
payload = subscribe_notification
|
|
216
216
|
import dummy_cities, batch_size: 2
|
|
217
217
|
expect(payload).to eq(index: CitiesIndex,
|
|
218
|
-
|
|
219
|
-
|
|
218
|
+
errors: {index: {mapper_parsing_exception => %w[1 2 3]}},
|
|
219
|
+
import: {index: 3})
|
|
220
220
|
end
|
|
221
221
|
end
|
|
222
222
|
end
|
|
@@ -567,7 +567,7 @@ describe Chewy::Index::Import do
|
|
|
567
567
|
before do
|
|
568
568
|
stub_index(:cities) do
|
|
569
569
|
crutch :names do |collection|
|
|
570
|
-
collection.
|
|
570
|
+
collection.to_h { |o| [o.name, "#{o.name}42"] }
|
|
571
571
|
end
|
|
572
572
|
field :name, value: ->(o, c) { c.names[o.name] }
|
|
573
573
|
field :rating
|
|
@@ -24,6 +24,8 @@ describe :search_index_receiver do
|
|
|
24
24
|
SearchIndexReceiver.new
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
+
let(:dummy_class) { Struct.new(:id) }
|
|
28
|
+
|
|
27
29
|
before do
|
|
28
30
|
stub_index(:dummies) do
|
|
29
31
|
root value: ->(_o) { {} }
|
|
@@ -82,12 +84,12 @@ describe :search_index_receiver do
|
|
|
82
84
|
end
|
|
83
85
|
|
|
84
86
|
specify 'validates that an object was indexed' do
|
|
85
|
-
dummy =
|
|
87
|
+
dummy = dummy_class.new(1)
|
|
86
88
|
expect(receiver.indexed?(dummy, DummiesIndex)).to be(true)
|
|
87
89
|
end
|
|
88
90
|
|
|
89
91
|
specify 'doesn\'t validate than unindexed objects were indexed' do
|
|
90
|
-
dummy =
|
|
92
|
+
dummy = dummy_class.new(2)
|
|
91
93
|
expect(receiver.indexed?(dummy, DummiesIndex)).to be(false)
|
|
92
94
|
end
|
|
93
95
|
end
|
|
@@ -98,12 +100,12 @@ describe :search_index_receiver do
|
|
|
98
100
|
end
|
|
99
101
|
|
|
100
102
|
specify 'validates than an object was deleted' do
|
|
101
|
-
dummy =
|
|
103
|
+
dummy = dummy_class.new(1)
|
|
102
104
|
expect(receiver.deleted?(dummy, DummiesIndex)).to be(true)
|
|
103
105
|
end
|
|
104
106
|
|
|
105
107
|
specify 'doesn\'t validate than undeleted objects were deleted' do
|
|
106
|
-
dummy =
|
|
108
|
+
dummy = dummy_class.new(2)
|
|
107
109
|
expect(receiver.deleted?(dummy, DummiesIndex)).to be(false)
|
|
108
110
|
end
|
|
109
111
|
end
|
|
@@ -105,10 +105,10 @@ Total: \\d+s\\Z
|
|
|
105
105
|
expect { described_class.reset(only: [CitiesIndex], output: output) }
|
|
106
106
|
.to update_index(CitiesIndex)
|
|
107
107
|
expect(output.string).to include(
|
|
108
|
-
"############################################################\n"\
|
|
109
|
-
"WARN: You are risking to lose some changes during the reset.\n" \
|
|
110
|
-
"
|
|
111
|
-
'
|
|
108
|
+
"############################################################\n" \
|
|
109
|
+
"WARN: You are risking to lose some changes during the reset.\n " \
|
|
110
|
+
"Please consider enabling journaling.\n " \
|
|
111
|
+
'See https://github.com/toptal/chewy#journaling'
|
|
112
112
|
)
|
|
113
113
|
end
|
|
114
114
|
end
|
|
@@ -24,7 +24,7 @@ shared_examples :kaminari do |request_base_class|
|
|
|
24
24
|
let(:data) { Array.new(10) { |i| {id: i.next.to_s, name: "Name#{i.next}", age: 10 * i.next}.stringify_keys! } }
|
|
25
25
|
|
|
26
26
|
before { ProductsIndex.import!(data.map { |h| double(h) }) }
|
|
27
|
-
before { allow(
|
|
27
|
+
before { allow(Kaminari.config).to receive_messages(default_per_page: 3) }
|
|
28
28
|
|
|
29
29
|
describe '#per, #page' do
|
|
30
30
|
specify { expect(search.map { |e| e.attributes.except(*except_fields) }).to match_array(data) }
|
|
@@ -6,7 +6,7 @@ describe Chewy::Search::Pagination::Kaminari do
|
|
|
6
6
|
let(:data) { Array.new(12) { |i| {id: i.next.to_s, name: "Name#{i.next}", age: 10 * i.next}.stringify_keys! } }
|
|
7
7
|
|
|
8
8
|
before { ProductsIndex.import!(data.map { |h| double(h) }) }
|
|
9
|
-
before { allow(
|
|
9
|
+
before { allow(Kaminari.config).to receive_messages(default_per_page: 17) }
|
|
10
10
|
|
|
11
11
|
specify { expect(search.objects.class).to eq(Kaminari::PaginatableArray) }
|
|
12
12
|
specify { expect(search.objects.total_count).to eq(12) }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
if defined?(
|
|
3
|
+
if defined?(ActiveJob)
|
|
4
4
|
describe Chewy::Strategy::ActiveJob do
|
|
5
5
|
around do |example|
|
|
6
6
|
active_job_settings = Chewy.settings[:active_job]
|
|
@@ -9,12 +9,12 @@ if defined?(::ActiveJob)
|
|
|
9
9
|
Chewy.settings[:active_job] = active_job_settings
|
|
10
10
|
end
|
|
11
11
|
before(:all) do
|
|
12
|
-
|
|
12
|
+
ActiveJob::Base.logger = Chewy.logger
|
|
13
13
|
end
|
|
14
14
|
before do
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
ActiveJob::Base.queue_adapter = :test
|
|
16
|
+
ActiveJob::Base.queue_adapter.enqueued_jobs.clear
|
|
17
|
+
ActiveJob::Base.queue_adapter.performed_jobs.clear
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
before do
|
|
@@ -39,7 +39,7 @@ if defined?(::ActiveJob)
|
|
|
39
39
|
Chewy.strategy(:active_job) do
|
|
40
40
|
[city, other_city].map(&:save!)
|
|
41
41
|
end
|
|
42
|
-
enqueued_job =
|
|
42
|
+
enqueued_job = ActiveJob::Base.queue_adapter.enqueued_jobs.first
|
|
43
43
|
expect(enqueued_job[:job]).to eq(Chewy::Strategy::ActiveJob::Worker)
|
|
44
44
|
expect(enqueued_job[:queue]).to eq('low')
|
|
45
45
|
end
|
|
@@ -48,12 +48,12 @@ if defined?(::ActiveJob)
|
|
|
48
48
|
Chewy.strategy(:active_job) do
|
|
49
49
|
[city, other_city].map(&:save!)
|
|
50
50
|
end
|
|
51
|
-
enqueued_job =
|
|
51
|
+
enqueued_job = ActiveJob::Base.queue_adapter.enqueued_jobs.first
|
|
52
52
|
expect(enqueued_job[:queue]).to eq('low')
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
specify do
|
|
56
|
-
|
|
56
|
+
ActiveJob::Base.queue_adapter = :inline
|
|
57
57
|
expect { [city, other_city].map(&:save!) }
|
|
58
58
|
.to update_index(CitiesIndex, strategy: :active_job)
|
|
59
59
|
.and_reindex(city, other_city).only
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
if defined?(
|
|
3
|
+
if defined?(Sidekiq)
|
|
4
4
|
require 'sidekiq/testing'
|
|
5
5
|
|
|
6
6
|
describe Chewy::Strategy::LazySidekiq do
|
|
@@ -10,7 +10,7 @@ if defined?(::Sidekiq)
|
|
|
10
10
|
Chewy.strategy(:bypass) { example.run }
|
|
11
11
|
Chewy.settings[:sidekiq] = sidekiq_settings
|
|
12
12
|
end
|
|
13
|
-
before {
|
|
13
|
+
before { Sidekiq::Worker.clear_all }
|
|
14
14
|
|
|
15
15
|
context 'strategy' do
|
|
16
16
|
before do
|
|
@@ -32,14 +32,14 @@ if defined?(::Sidekiq)
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
it 'updates indices asynchronously on record save' do
|
|
35
|
-
expect(
|
|
35
|
+
expect(Sidekiq::Client).to receive(:push)
|
|
36
36
|
.with(hash_including(
|
|
37
37
|
'class' => Chewy::Strategy::LazySidekiq::IndicesUpdateWorker,
|
|
38
38
|
'queue' => 'low'
|
|
39
39
|
))
|
|
40
40
|
.and_call_original
|
|
41
41
|
.once
|
|
42
|
-
|
|
42
|
+
Sidekiq::Testing.inline! do
|
|
43
43
|
expect { [city, other_city].map(&:save!) }
|
|
44
44
|
.to update_index(CitiesIndex, strategy: :lazy_sidekiq)
|
|
45
45
|
.and_reindex(city, other_city).only
|
|
@@ -47,12 +47,12 @@ if defined?(::Sidekiq)
|
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
it 'updates indices asynchronously with falling back to sidekiq strategy on record destroy' do
|
|
50
|
-
expect(
|
|
50
|
+
expect(Sidekiq::Client).not_to receive(:push)
|
|
51
51
|
.with(hash_including(
|
|
52
52
|
'class' => Chewy::Strategy::LazySidekiq::IndicesUpdateWorker,
|
|
53
53
|
'queue' => 'low'
|
|
54
54
|
))
|
|
55
|
-
expect(
|
|
55
|
+
expect(Sidekiq::Client).to receive(:push)
|
|
56
56
|
.with(hash_including(
|
|
57
57
|
'class' => Chewy::Strategy::Sidekiq::Worker,
|
|
58
58
|
'queue' => 'low',
|
|
@@ -60,7 +60,7 @@ if defined?(::Sidekiq)
|
|
|
60
60
|
))
|
|
61
61
|
.and_call_original
|
|
62
62
|
.once
|
|
63
|
-
|
|
63
|
+
Sidekiq::Testing.inline! do
|
|
64
64
|
expect { [city, other_city].map(&:destroy) }.to update_index(CitiesIndex, strategy: :sidekiq)
|
|
65
65
|
end
|
|
66
66
|
end
|
|
@@ -71,7 +71,7 @@ if defined?(::Sidekiq)
|
|
|
71
71
|
expect(other_city).to receive(:run_chewy_callbacks).and_call_original
|
|
72
72
|
|
|
73
73
|
expect do
|
|
74
|
-
|
|
74
|
+
Sidekiq::Testing.inline! do
|
|
75
75
|
Chewy::Strategy::LazySidekiq::IndicesUpdateWorker.new.perform({'City' => [city.id, other_city.id]})
|
|
76
76
|
end
|
|
77
77
|
end.to update_index(CitiesIndex).and_reindex(city, other_city).only
|
|
@@ -88,7 +88,7 @@ if defined?(::Sidekiq)
|
|
|
88
88
|
expect(other_city).to receive(:run_chewy_callbacks).and_call_original
|
|
89
89
|
|
|
90
90
|
expect do
|
|
91
|
-
|
|
91
|
+
Sidekiq::Testing.inline! do
|
|
92
92
|
Chewy::Strategy::LazySidekiq::IndicesUpdateWorker.new.perform({'City' => [city.id, other_city.id]})
|
|
93
93
|
end
|
|
94
94
|
end.to update_index(CitiesIndex).and_reindex(city, other_city).only.no_refresh
|
|
@@ -97,7 +97,7 @@ if defined?(::Sidekiq)
|
|
|
97
97
|
end
|
|
98
98
|
|
|
99
99
|
context 'integration' do
|
|
100
|
-
around { |example|
|
|
100
|
+
around { |example| Sidekiq::Testing.inline! { example.run } }
|
|
101
101
|
|
|
102
102
|
let(:update_condition) { true }
|
|
103
103
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
|
-
if defined?(
|
|
3
|
+
if defined?(Sidekiq)
|
|
4
4
|
require 'sidekiq/testing'
|
|
5
5
|
|
|
6
6
|
describe Chewy::Strategy::Sidekiq do
|
|
@@ -10,7 +10,7 @@ if defined?(::Sidekiq)
|
|
|
10
10
|
Chewy.strategy(:bypass) { example.run }
|
|
11
11
|
Chewy.settings[:sidekiq] = sidekiq_settings
|
|
12
12
|
end
|
|
13
|
-
before {
|
|
13
|
+
before { Sidekiq::Worker.clear_all }
|
|
14
14
|
before do
|
|
15
15
|
stub_model(:city) do
|
|
16
16
|
update_index('cities') { self }
|
|
@@ -30,8 +30,8 @@ if defined?(::Sidekiq)
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
specify do
|
|
33
|
-
expect(
|
|
34
|
-
|
|
33
|
+
expect(Sidekiq::Client).to receive(:push).with(hash_including('queue' => 'low')).and_call_original
|
|
34
|
+
Sidekiq::Testing.inline! do
|
|
35
35
|
expect { [city, other_city].map(&:save!) }
|
|
36
36
|
.to update_index(CitiesIndex, strategy: :sidekiq)
|
|
37
37
|
.and_reindex(city, other_city).only
|
data/spec/chewy_spec.rb
CHANGED
|
@@ -59,7 +59,7 @@ describe Chewy do
|
|
|
59
59
|
Chewy.current[:chewy_client] = nil
|
|
60
60
|
allow(Chewy).to receive_messages(configuration: {transport_options: {proc: faraday_block}})
|
|
61
61
|
|
|
62
|
-
allow(
|
|
62
|
+
allow(Elasticsearch::Client).to receive(:new).with(expected_client_config) do |*_args, &passed_block|
|
|
63
63
|
# RSpec's `with(..., &block)` was used previously, but doesn't actually do
|
|
64
64
|
# any verification of the passed block (even of its presence).
|
|
65
65
|
expect(passed_block.source_location).to eq(faraday_block.source_location)
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: chewy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.
|
|
4
|
+
version: 7.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Toptal, LLC
|
|
@@ -11,174 +11,6 @@ bindir: bin
|
|
|
11
11
|
cert_chain: []
|
|
12
12
|
date: 2023-12-13 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
|
-
- !ruby/object:Gem::Dependency
|
|
15
|
-
name: database_cleaner
|
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
|
17
|
-
requirements:
|
|
18
|
-
- - ">="
|
|
19
|
-
- !ruby/object:Gem::Version
|
|
20
|
-
version: '0'
|
|
21
|
-
type: :development
|
|
22
|
-
prerelease: false
|
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
24
|
-
requirements:
|
|
25
|
-
- - ">="
|
|
26
|
-
- !ruby/object:Gem::Version
|
|
27
|
-
version: '0'
|
|
28
|
-
- !ruby/object:Gem::Dependency
|
|
29
|
-
name: elasticsearch-extensions
|
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
|
31
|
-
requirements:
|
|
32
|
-
- - ">="
|
|
33
|
-
- !ruby/object:Gem::Version
|
|
34
|
-
version: '0'
|
|
35
|
-
type: :development
|
|
36
|
-
prerelease: false
|
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
38
|
-
requirements:
|
|
39
|
-
- - ">="
|
|
40
|
-
- !ruby/object:Gem::Version
|
|
41
|
-
version: '0'
|
|
42
|
-
- !ruby/object:Gem::Dependency
|
|
43
|
-
name: mock_redis
|
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
|
45
|
-
requirements:
|
|
46
|
-
- - ">="
|
|
47
|
-
- !ruby/object:Gem::Version
|
|
48
|
-
version: '0'
|
|
49
|
-
type: :development
|
|
50
|
-
prerelease: false
|
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
52
|
-
requirements:
|
|
53
|
-
- - ">="
|
|
54
|
-
- !ruby/object:Gem::Version
|
|
55
|
-
version: '0'
|
|
56
|
-
- !ruby/object:Gem::Dependency
|
|
57
|
-
name: rake
|
|
58
|
-
requirement: !ruby/object:Gem::Requirement
|
|
59
|
-
requirements:
|
|
60
|
-
- - ">="
|
|
61
|
-
- !ruby/object:Gem::Version
|
|
62
|
-
version: '0'
|
|
63
|
-
type: :development
|
|
64
|
-
prerelease: false
|
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
66
|
-
requirements:
|
|
67
|
-
- - ">="
|
|
68
|
-
- !ruby/object:Gem::Version
|
|
69
|
-
version: '0'
|
|
70
|
-
- !ruby/object:Gem::Dependency
|
|
71
|
-
name: rspec
|
|
72
|
-
requirement: !ruby/object:Gem::Requirement
|
|
73
|
-
requirements:
|
|
74
|
-
- - ">="
|
|
75
|
-
- !ruby/object:Gem::Version
|
|
76
|
-
version: 3.7.0
|
|
77
|
-
type: :development
|
|
78
|
-
prerelease: false
|
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
80
|
-
requirements:
|
|
81
|
-
- - ">="
|
|
82
|
-
- !ruby/object:Gem::Version
|
|
83
|
-
version: 3.7.0
|
|
84
|
-
- !ruby/object:Gem::Dependency
|
|
85
|
-
name: rspec-collection_matchers
|
|
86
|
-
requirement: !ruby/object:Gem::Requirement
|
|
87
|
-
requirements:
|
|
88
|
-
- - ">="
|
|
89
|
-
- !ruby/object:Gem::Version
|
|
90
|
-
version: '0'
|
|
91
|
-
type: :development
|
|
92
|
-
prerelease: false
|
|
93
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
94
|
-
requirements:
|
|
95
|
-
- - ">="
|
|
96
|
-
- !ruby/object:Gem::Version
|
|
97
|
-
version: '0'
|
|
98
|
-
- !ruby/object:Gem::Dependency
|
|
99
|
-
name: rspec-its
|
|
100
|
-
requirement: !ruby/object:Gem::Requirement
|
|
101
|
-
requirements:
|
|
102
|
-
- - ">="
|
|
103
|
-
- !ruby/object:Gem::Version
|
|
104
|
-
version: '0'
|
|
105
|
-
type: :development
|
|
106
|
-
prerelease: false
|
|
107
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
108
|
-
requirements:
|
|
109
|
-
- - ">="
|
|
110
|
-
- !ruby/object:Gem::Version
|
|
111
|
-
version: '0'
|
|
112
|
-
- !ruby/object:Gem::Dependency
|
|
113
|
-
name: rubocop
|
|
114
|
-
requirement: !ruby/object:Gem::Requirement
|
|
115
|
-
requirements:
|
|
116
|
-
- - '='
|
|
117
|
-
- !ruby/object:Gem::Version
|
|
118
|
-
version: '1.11'
|
|
119
|
-
type: :development
|
|
120
|
-
prerelease: false
|
|
121
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
122
|
-
requirements:
|
|
123
|
-
- - '='
|
|
124
|
-
- !ruby/object:Gem::Version
|
|
125
|
-
version: '1.11'
|
|
126
|
-
- !ruby/object:Gem::Dependency
|
|
127
|
-
name: sqlite3
|
|
128
|
-
requirement: !ruby/object:Gem::Requirement
|
|
129
|
-
requirements:
|
|
130
|
-
- - ">="
|
|
131
|
-
- !ruby/object:Gem::Version
|
|
132
|
-
version: '0'
|
|
133
|
-
type: :development
|
|
134
|
-
prerelease: false
|
|
135
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
136
|
-
requirements:
|
|
137
|
-
- - ">="
|
|
138
|
-
- !ruby/object:Gem::Version
|
|
139
|
-
version: '0'
|
|
140
|
-
- !ruby/object:Gem::Dependency
|
|
141
|
-
name: timecop
|
|
142
|
-
requirement: !ruby/object:Gem::Requirement
|
|
143
|
-
requirements:
|
|
144
|
-
- - ">="
|
|
145
|
-
- !ruby/object:Gem::Version
|
|
146
|
-
version: '0'
|
|
147
|
-
type: :development
|
|
148
|
-
prerelease: false
|
|
149
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
150
|
-
requirements:
|
|
151
|
-
- - ">="
|
|
152
|
-
- !ruby/object:Gem::Version
|
|
153
|
-
version: '0'
|
|
154
|
-
- !ruby/object:Gem::Dependency
|
|
155
|
-
name: method_source
|
|
156
|
-
requirement: !ruby/object:Gem::Requirement
|
|
157
|
-
requirements:
|
|
158
|
-
- - ">="
|
|
159
|
-
- !ruby/object:Gem::Version
|
|
160
|
-
version: '0'
|
|
161
|
-
type: :development
|
|
162
|
-
prerelease: false
|
|
163
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
164
|
-
requirements:
|
|
165
|
-
- - ">="
|
|
166
|
-
- !ruby/object:Gem::Version
|
|
167
|
-
version: '0'
|
|
168
|
-
- !ruby/object:Gem::Dependency
|
|
169
|
-
name: unparser
|
|
170
|
-
requirement: !ruby/object:Gem::Requirement
|
|
171
|
-
requirements:
|
|
172
|
-
- - ">="
|
|
173
|
-
- !ruby/object:Gem::Version
|
|
174
|
-
version: '0'
|
|
175
|
-
type: :development
|
|
176
|
-
prerelease: false
|
|
177
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
178
|
-
requirements:
|
|
179
|
-
- - ">="
|
|
180
|
-
- !ruby/object:Gem::Version
|
|
181
|
-
version: '0'
|
|
182
14
|
- !ruby/object:Gem::Dependency
|
|
183
15
|
name: activesupport
|
|
184
16
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -257,8 +89,7 @@ files:
|
|
|
257
89
|
- Rakefile
|
|
258
90
|
- chewy.gemspec
|
|
259
91
|
- filters
|
|
260
|
-
- gemfiles/
|
|
261
|
-
- gemfiles/rails.6.0.activerecord.gemfile
|
|
92
|
+
- gemfiles/base.gemfile
|
|
262
93
|
- gemfiles/rails.6.1.activerecord.gemfile
|
|
263
94
|
- gemfiles/rails.7.0.activerecord.gemfile
|
|
264
95
|
- gemfiles/rails.7.1.activerecord.gemfile
|
|
@@ -470,7 +301,8 @@ files:
|
|
|
470
301
|
homepage: https://github.com/toptal/chewy
|
|
471
302
|
licenses:
|
|
472
303
|
- MIT
|
|
473
|
-
metadata:
|
|
304
|
+
metadata:
|
|
305
|
+
rubygems_mfa_required: 'true'
|
|
474
306
|
post_install_message:
|
|
475
307
|
rdoc_options: []
|
|
476
308
|
require_paths:
|
|
@@ -490,99 +322,4 @@ rubygems_version: 3.4.10
|
|
|
490
322
|
signing_key:
|
|
491
323
|
specification_version: 4
|
|
492
324
|
summary: Elasticsearch ODM client wrapper
|
|
493
|
-
test_files:
|
|
494
|
-
- spec/chewy/config_spec.rb
|
|
495
|
-
- spec/chewy/fields/base_spec.rb
|
|
496
|
-
- spec/chewy/fields/root_spec.rb
|
|
497
|
-
- spec/chewy/fields/time_fields_spec.rb
|
|
498
|
-
- spec/chewy/index/actions_spec.rb
|
|
499
|
-
- spec/chewy/index/adapter/active_record_spec.rb
|
|
500
|
-
- spec/chewy/index/adapter/object_spec.rb
|
|
501
|
-
- spec/chewy/index/aliases_spec.rb
|
|
502
|
-
- spec/chewy/index/import/bulk_builder_spec.rb
|
|
503
|
-
- spec/chewy/index/import/bulk_request_spec.rb
|
|
504
|
-
- spec/chewy/index/import/journal_builder_spec.rb
|
|
505
|
-
- spec/chewy/index/import/routine_spec.rb
|
|
506
|
-
- spec/chewy/index/import_spec.rb
|
|
507
|
-
- spec/chewy/index/mapping_spec.rb
|
|
508
|
-
- spec/chewy/index/observe/active_record_methods_spec.rb
|
|
509
|
-
- spec/chewy/index/observe/callback_spec.rb
|
|
510
|
-
- spec/chewy/index/observe_spec.rb
|
|
511
|
-
- spec/chewy/index/settings_spec.rb
|
|
512
|
-
- spec/chewy/index/specification_spec.rb
|
|
513
|
-
- spec/chewy/index/syncer_spec.rb
|
|
514
|
-
- spec/chewy/index/witchcraft_spec.rb
|
|
515
|
-
- spec/chewy/index/wrapper_spec.rb
|
|
516
|
-
- spec/chewy/index_spec.rb
|
|
517
|
-
- spec/chewy/journal_spec.rb
|
|
518
|
-
- spec/chewy/minitest/helpers_spec.rb
|
|
519
|
-
- spec/chewy/minitest/search_index_receiver_spec.rb
|
|
520
|
-
- spec/chewy/multi_search_spec.rb
|
|
521
|
-
- spec/chewy/rake_helper_spec.rb
|
|
522
|
-
- spec/chewy/repository_spec.rb
|
|
523
|
-
- spec/chewy/rspec/build_query_spec.rb
|
|
524
|
-
- spec/chewy/rspec/helpers_spec.rb
|
|
525
|
-
- spec/chewy/rspec/update_index_spec.rb
|
|
526
|
-
- spec/chewy/runtime/version_spec.rb
|
|
527
|
-
- spec/chewy/runtime_spec.rb
|
|
528
|
-
- spec/chewy/search/loader_spec.rb
|
|
529
|
-
- spec/chewy/search/pagination/kaminari_examples.rb
|
|
530
|
-
- spec/chewy/search/pagination/kaminari_spec.rb
|
|
531
|
-
- spec/chewy/search/parameters/aggs_spec.rb
|
|
532
|
-
- spec/chewy/search/parameters/bool_storage_examples.rb
|
|
533
|
-
- spec/chewy/search/parameters/collapse_spec.rb
|
|
534
|
-
- spec/chewy/search/parameters/docvalue_fields_spec.rb
|
|
535
|
-
- spec/chewy/search/parameters/explain_spec.rb
|
|
536
|
-
- spec/chewy/search/parameters/filter_spec.rb
|
|
537
|
-
- spec/chewy/search/parameters/hash_storage_examples.rb
|
|
538
|
-
- spec/chewy/search/parameters/highlight_spec.rb
|
|
539
|
-
- spec/chewy/search/parameters/ignore_unavailable_spec.rb
|
|
540
|
-
- spec/chewy/search/parameters/indices_spec.rb
|
|
541
|
-
- spec/chewy/search/parameters/integer_storage_examples.rb
|
|
542
|
-
- spec/chewy/search/parameters/knn_spec.rb
|
|
543
|
-
- spec/chewy/search/parameters/limit_spec.rb
|
|
544
|
-
- spec/chewy/search/parameters/load_spec.rb
|
|
545
|
-
- spec/chewy/search/parameters/min_score_spec.rb
|
|
546
|
-
- spec/chewy/search/parameters/none_spec.rb
|
|
547
|
-
- spec/chewy/search/parameters/offset_spec.rb
|
|
548
|
-
- spec/chewy/search/parameters/order_spec.rb
|
|
549
|
-
- spec/chewy/search/parameters/post_filter_spec.rb
|
|
550
|
-
- spec/chewy/search/parameters/preference_spec.rb
|
|
551
|
-
- spec/chewy/search/parameters/profile_spec.rb
|
|
552
|
-
- spec/chewy/search/parameters/query_spec.rb
|
|
553
|
-
- spec/chewy/search/parameters/query_storage_examples.rb
|
|
554
|
-
- spec/chewy/search/parameters/request_cache_spec.rb
|
|
555
|
-
- spec/chewy/search/parameters/rescore_spec.rb
|
|
556
|
-
- spec/chewy/search/parameters/script_fields_spec.rb
|
|
557
|
-
- spec/chewy/search/parameters/search_after_spec.rb
|
|
558
|
-
- spec/chewy/search/parameters/search_type_spec.rb
|
|
559
|
-
- spec/chewy/search/parameters/source_spec.rb
|
|
560
|
-
- spec/chewy/search/parameters/storage_spec.rb
|
|
561
|
-
- spec/chewy/search/parameters/stored_fields_spec.rb
|
|
562
|
-
- spec/chewy/search/parameters/string_array_storage_examples.rb
|
|
563
|
-
- spec/chewy/search/parameters/string_storage_examples.rb
|
|
564
|
-
- spec/chewy/search/parameters/suggest_spec.rb
|
|
565
|
-
- spec/chewy/search/parameters/terminate_after_spec.rb
|
|
566
|
-
- spec/chewy/search/parameters/timeout_spec.rb
|
|
567
|
-
- spec/chewy/search/parameters/track_scores_spec.rb
|
|
568
|
-
- spec/chewy/search/parameters/track_total_hits_spec.rb
|
|
569
|
-
- spec/chewy/search/parameters/version_spec.rb
|
|
570
|
-
- spec/chewy/search/parameters_spec.rb
|
|
571
|
-
- spec/chewy/search/query_proxy_spec.rb
|
|
572
|
-
- spec/chewy/search/request_spec.rb
|
|
573
|
-
- spec/chewy/search/response_spec.rb
|
|
574
|
-
- spec/chewy/search/scrolling_spec.rb
|
|
575
|
-
- spec/chewy/search_spec.rb
|
|
576
|
-
- spec/chewy/stash_spec.rb
|
|
577
|
-
- spec/chewy/strategy/active_job_spec.rb
|
|
578
|
-
- spec/chewy/strategy/atomic_no_refresh_spec.rb
|
|
579
|
-
- spec/chewy/strategy/atomic_spec.rb
|
|
580
|
-
- spec/chewy/strategy/delayed_sidekiq_spec.rb
|
|
581
|
-
- spec/chewy/strategy/lazy_sidekiq_spec.rb
|
|
582
|
-
- spec/chewy/strategy/sidekiq_spec.rb
|
|
583
|
-
- spec/chewy/strategy_spec.rb
|
|
584
|
-
- spec/chewy_spec.rb
|
|
585
|
-
- spec/spec_helper.rb
|
|
586
|
-
- spec/support/active_record.rb
|
|
587
|
-
- spec/support/class_helpers.rb
|
|
588
|
-
- spec/support/fail_helpers.rb
|
|
325
|
+
test_files: []
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
|
|
3
|
-
gem 'activejob', '~> 5.2.0'
|
|
4
|
-
gem 'activerecord', '~> 5.2.0'
|
|
5
|
-
gem 'activesupport', '~> 5.2.0'
|
|
6
|
-
gem 'kaminari-core', '~> 1.1.0', require: false
|
|
7
|
-
gem 'parallel', require: false
|
|
8
|
-
gem 'rspec_junit_formatter', '~> 0.4.1'
|
|
9
|
-
gem 'sidekiq', require: false
|
|
10
|
-
|
|
11
|
-
gemspec path: '../'
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
|
|
3
|
-
gem 'activejob', '~> 6.0.0'
|
|
4
|
-
gem 'activerecord', '~> 6.0.0'
|
|
5
|
-
gem 'activesupport', '~> 6.0.0'
|
|
6
|
-
gem 'kaminari-core', '~> 1.1.0', require: false
|
|
7
|
-
gem 'parallel', require: false
|
|
8
|
-
gem 'rspec_junit_formatter', '~> 0.4.1'
|
|
9
|
-
gem 'sidekiq', require: false
|
|
10
|
-
|
|
11
|
-
gemspec path: '../'
|