chewy 7.1.0 → 7.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +58 -0
- data/.rubocop.yml +13 -8
- data/.rubocop_todo.yml +110 -22
- data/CHANGELOG.md +112 -0
- data/Gemfile +0 -7
- data/Guardfile +3 -1
- data/README.md +307 -248
- data/chewy.gemspec +4 -6
- data/gemfiles/rails.5.2.activerecord.gemfile +8 -14
- data/gemfiles/rails.6.0.activerecord.gemfile +8 -14
- data/gemfiles/rails.6.1.activerecord.gemfile +8 -14
- data/lib/chewy/config.rb +41 -41
- data/lib/chewy/errors.rb +0 -12
- data/lib/chewy/fields/base.rb +11 -1
- data/lib/chewy/fields/root.rb +3 -4
- data/lib/chewy/index/actions.rb +51 -32
- data/lib/chewy/{type → index}/adapter/active_record.rb +12 -3
- data/lib/chewy/{type → index}/adapter/base.rb +2 -3
- data/lib/chewy/{type → index}/adapter/object.rb +27 -31
- data/lib/chewy/{type → index}/adapter/orm.rb +11 -14
- data/lib/chewy/{type → index}/crutch.rb +5 -5
- data/lib/chewy/{type → index}/import/bulk_builder.rb +15 -13
- data/lib/chewy/{type → index}/import/bulk_request.rb +6 -6
- data/lib/chewy/{type → index}/import/journal_builder.rb +10 -10
- data/lib/chewy/{type → index}/import/routine.rb +15 -14
- data/lib/chewy/{type → index}/import.rb +36 -27
- data/lib/chewy/{type → index}/mapping.rb +26 -31
- data/lib/chewy/{type → index}/observe.rb +9 -19
- data/lib/chewy/index/specification.rb +1 -0
- data/lib/chewy/{type → index}/syncer.rb +60 -57
- data/lib/chewy/{type → index}/witchcraft.rb +11 -7
- data/lib/chewy/{type → index}/wrapper.rb +2 -2
- data/lib/chewy/index.rb +46 -87
- data/lib/chewy/journal.rb +8 -8
- data/lib/chewy/minitest/helpers.rb +86 -13
- data/lib/chewy/minitest/search_index_receiver.rb +22 -26
- data/lib/chewy/railtie.rb +4 -2
- data/lib/chewy/rake_helper.rb +103 -108
- data/lib/chewy/rspec/build_query.rb +12 -0
- data/lib/chewy/rspec/helpers.rb +55 -0
- data/lib/chewy/rspec/update_index.rb +47 -43
- data/lib/chewy/rspec.rb +2 -0
- data/lib/chewy/runtime.rb +1 -1
- data/lib/chewy/search/loader.rb +18 -30
- data/lib/chewy/search/parameters/concerns/query_storage.rb +2 -2
- data/lib/chewy/search/parameters/ignore_unavailable.rb +27 -0
- data/lib/chewy/search/parameters/order.rb +6 -19
- data/lib/chewy/search/parameters/source.rb +5 -1
- data/lib/chewy/search/parameters/track_total_hits.rb +16 -0
- data/lib/chewy/search/parameters.rb +5 -3
- data/lib/chewy/search/query_proxy.rb +9 -2
- data/lib/chewy/search/request.rb +110 -90
- data/lib/chewy/search/response.rb +4 -4
- data/lib/chewy/search/scoping.rb +7 -8
- data/lib/chewy/search/scrolling.rb +12 -12
- data/lib/chewy/search.rb +4 -17
- data/lib/chewy/stash.rb +14 -22
- data/lib/chewy/strategy/sidekiq.rb +1 -0
- data/lib/chewy/strategy.rb +3 -19
- data/lib/chewy/version.rb +1 -1
- data/lib/chewy.rb +34 -78
- data/lib/generators/chewy/install_generator.rb +1 -1
- data/lib/tasks/chewy.rake +10 -22
- data/migration_guide.md +20 -1
- data/spec/chewy/config_spec.rb +14 -39
- data/spec/chewy/fields/base_spec.rb +412 -148
- data/spec/chewy/fields/root_spec.rb +16 -24
- data/spec/chewy/fields/time_fields_spec.rb +5 -5
- data/spec/chewy/index/actions_spec.rb +270 -24
- data/spec/chewy/{type → index}/adapter/active_record_spec.rb +68 -40
- data/spec/chewy/{type → index}/adapter/object_spec.rb +21 -6
- data/spec/chewy/{type → index}/import/bulk_builder_spec.rb +23 -31
- data/spec/chewy/{type → index}/import/bulk_request_spec.rb +5 -6
- data/spec/chewy/{type → index}/import/journal_builder_spec.rb +9 -15
- data/spec/chewy/{type → index}/import/routine_spec.rb +16 -16
- data/spec/chewy/{type → index}/import_spec.rb +102 -98
- data/spec/chewy/{type → index}/mapping_spec.rb +46 -54
- data/spec/chewy/index/observe_spec.rb +116 -0
- data/spec/chewy/index/settings_spec.rb +3 -1
- data/spec/chewy/index/specification_spec.rb +7 -17
- data/spec/chewy/{type → index}/syncer_spec.rb +14 -19
- data/spec/chewy/{type → index}/witchcraft_spec.rb +20 -22
- data/spec/chewy/index/wrapper_spec.rb +100 -0
- data/spec/chewy/index_spec.rb +59 -102
- data/spec/chewy/journal_spec.rb +9 -22
- data/spec/chewy/minitest/helpers_spec.rb +122 -14
- data/spec/chewy/minitest/search_index_receiver_spec.rb +22 -26
- data/spec/chewy/multi_search_spec.rb +4 -5
- data/spec/chewy/rake_helper_spec.rb +164 -55
- data/spec/chewy/rspec/build_query_spec.rb +34 -0
- data/spec/chewy/rspec/helpers_spec.rb +61 -0
- data/spec/chewy/rspec/update_index_spec.rb +74 -71
- data/spec/chewy/search/loader_spec.rb +19 -37
- data/spec/chewy/search/pagination/kaminari_examples.rb +3 -5
- data/spec/chewy/search/pagination/kaminari_spec.rb +1 -1
- data/spec/chewy/search/parameters/ignore_unavailable_spec.rb +67 -0
- data/spec/chewy/search/parameters/indices_spec.rb +2 -8
- data/spec/chewy/search/parameters/order_spec.rb +18 -11
- data/spec/chewy/search/parameters/query_storage_examples.rb +67 -21
- data/spec/chewy/search/parameters/search_after_spec.rb +4 -1
- data/spec/chewy/search/parameters/source_spec.rb +8 -2
- data/spec/chewy/search/parameters/track_total_hits_spec.rb +5 -0
- data/spec/chewy/search/parameters_spec.rb +18 -4
- data/spec/chewy/search/query_proxy_spec.rb +68 -17
- data/spec/chewy/search/request_spec.rb +243 -83
- data/spec/chewy/search/response_spec.rb +12 -12
- data/spec/chewy/search/scrolling_spec.rb +8 -10
- data/spec/chewy/search_spec.rb +32 -35
- data/spec/chewy/stash_spec.rb +9 -21
- data/spec/chewy/strategy/active_job_spec.rb +8 -8
- data/spec/chewy/strategy/atomic_spec.rb +9 -10
- data/spec/chewy/strategy/sidekiq_spec.rb +8 -8
- data/spec/chewy/strategy_spec.rb +19 -15
- data/spec/chewy_spec.rb +17 -103
- data/spec/spec_helper.rb +2 -21
- data/spec/support/active_record.rb +15 -5
- metadata +64 -105
- data/.circleci/config.yml +0 -214
- data/Appraisals +0 -81
- data/gemfiles/rails.5.2.mongoid.6.4.gemfile +0 -17
- data/gemfiles/sequel.4.45.gemfile +0 -11
- data/lib/chewy/search/pagination/will_paginate.rb +0 -43
- data/lib/chewy/strategy/resque.rb +0 -27
- data/lib/chewy/strategy/shoryuken.rb +0 -40
- data/lib/chewy/type/actions.rb +0 -43
- data/lib/chewy/type/adapter/mongoid.rb +0 -67
- data/lib/chewy/type/adapter/sequel.rb +0 -93
- data/lib/chewy/type.rb +0 -120
- data/lib/sequel/plugins/chewy_observe.rb +0 -63
- data/spec/chewy/search/pagination/will_paginate_examples.rb +0 -63
- data/spec/chewy/search/pagination/will_paginate_spec.rb +0 -23
- data/spec/chewy/strategy/resque_spec.rb +0 -46
- data/spec/chewy/strategy/shoryuken_spec.rb +0 -70
- data/spec/chewy/type/actions_spec.rb +0 -50
- data/spec/chewy/type/adapter/mongoid_spec.rb +0 -372
- data/spec/chewy/type/adapter/sequel_spec.rb +0 -472
- data/spec/chewy/type/observe_spec.rb +0 -137
- data/spec/chewy/type/wrapper_spec.rb +0 -100
- data/spec/chewy/type_spec.rb +0 -55
- data/spec/support/mongoid.rb +0 -93
- data/spec/support/sequel.rb +0 -80
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a027fc99d931ad37a70f2cdf906363917af16afc6dd82bbc1da8066e63dad9ee
|
4
|
+
data.tar.gz: 602bbb699c4971f8653207bb52d8bb7c40899128b1c6034c89f0f4481207f569
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 444a1e44ad27a6d066daf31ceee258ee51e4ef1398fe6af4bf7294090b2391d2f136aa1726d5eb9f1c22f1c87abfd16f4a05c1198a0496e2062a13f8f31340db
|
7
|
+
data.tar.gz: 5f484506393af6b6959593850c9c7cb73307628076eb9676bd72e53b7fa02a987986d79443c35c2c7a0efd652615fb7ccf6ed418ab7bdf85eb69fbe6b2b02c24
|
@@ -0,0 +1,58 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
tests:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
strategy:
|
9
|
+
fail-fast: false
|
10
|
+
matrix:
|
11
|
+
ruby: [2.6, 2.7]
|
12
|
+
gemfile: [rails.5.2.activerecord, rails.6.0.activerecord, rails.6.1.activerecord]
|
13
|
+
name: ${{ matrix.ruby }}-${{ matrix.gemfile }}
|
14
|
+
|
15
|
+
env:
|
16
|
+
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
|
17
|
+
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@v2
|
20
|
+
- uses: ruby/setup-ruby@v1
|
21
|
+
with:
|
22
|
+
ruby-version: ${{ matrix.ruby }}
|
23
|
+
bundler-cache: true
|
24
|
+
- name: Run Elasticsearch
|
25
|
+
uses: elastic/elastic-github-actions/elasticsearch@9de0f78f306e4ebc0838f057e6b754364685e759
|
26
|
+
with:
|
27
|
+
stack-version: 7.10.1
|
28
|
+
port: 9250
|
29
|
+
- name: Tests
|
30
|
+
run: bundle exec rspec
|
31
|
+
|
32
|
+
ruby-3-0-activerecord-6-1:
|
33
|
+
runs-on: ubuntu-latest
|
34
|
+
env:
|
35
|
+
BUNDLE_GEMFILE: gemfiles/rails.6.1.activerecord.gemfile
|
36
|
+
steps:
|
37
|
+
- uses: actions/checkout@v2
|
38
|
+
- uses: ruby/setup-ruby@v1
|
39
|
+
with:
|
40
|
+
ruby-version: '3.0'
|
41
|
+
bundler-cache: true
|
42
|
+
- name: Run Elasticsearch
|
43
|
+
uses: elastic/elastic-github-actions/elasticsearch@9de0f78f306e4ebc0838f057e6b754364685e759
|
44
|
+
with:
|
45
|
+
stack-version: 7.10.1
|
46
|
+
port: 9250
|
47
|
+
- name: Tests
|
48
|
+
run: bundle exec rspec
|
49
|
+
|
50
|
+
rubocop:
|
51
|
+
runs-on: ubuntu-latest
|
52
|
+
steps:
|
53
|
+
- uses: actions/checkout@v2
|
54
|
+
- uses: ruby/setup-ruby@v1
|
55
|
+
with:
|
56
|
+
ruby-version: 2.7
|
57
|
+
bundler-cache: true
|
58
|
+
- run: bundle exec rubocop --format simple
|
data/.rubocop.yml
CHANGED
@@ -1,24 +1,31 @@
|
|
1
1
|
inherit_from: .rubocop_todo.yml
|
2
2
|
|
3
|
+
AllCops:
|
4
|
+
NewCops: enable
|
5
|
+
TargetRubyVersion: 2.6
|
6
|
+
|
3
7
|
Layout/AccessModifierIndentation:
|
4
8
|
EnforcedStyle: outdent
|
5
9
|
|
6
|
-
Layout/
|
10
|
+
Layout/HashAlignment:
|
7
11
|
EnforcedLastArgumentHashStyle: always_ignore
|
8
12
|
|
9
|
-
Layout/
|
13
|
+
Layout/ParameterAlignment:
|
10
14
|
EnforcedStyle: with_fixed_indentation
|
11
15
|
|
12
16
|
Layout/CaseIndentation:
|
13
17
|
EnforcedStyle: end
|
14
18
|
|
15
|
-
Layout/
|
19
|
+
Layout/EndAlignment:
|
20
|
+
EnforcedStyleAlignWith: variable
|
21
|
+
|
22
|
+
Layout/FirstArrayElementIndentation:
|
16
23
|
EnforcedStyle: consistent
|
17
24
|
|
18
|
-
Layout/
|
25
|
+
Layout/FirstHashElementIndentation:
|
19
26
|
EnforcedStyle: consistent
|
20
27
|
|
21
|
-
Layout/
|
28
|
+
Layout/HeredocIndentation:
|
22
29
|
Enabled: false
|
23
30
|
|
24
31
|
Layout/MultilineMethodCallIndentation:
|
@@ -33,9 +40,6 @@ Layout/SpaceInsideHashLiteralBraces:
|
|
33
40
|
Lint/AmbiguousBlockAssociation:
|
34
41
|
Enabled: false
|
35
42
|
|
36
|
-
Lint/EndAlignment:
|
37
|
-
EnforcedStyleAlignWith: variable
|
38
|
-
|
39
43
|
Style/Alias:
|
40
44
|
EnforcedStyle: prefer_alias_method
|
41
45
|
|
@@ -53,4 +57,5 @@ Metrics/BlockLength:
|
|
53
57
|
|
54
58
|
Metrics/ModuleLength:
|
55
59
|
Exclude:
|
60
|
+
- 'lib/chewy/rake_helper.rb'
|
56
61
|
- '**/*_spec.rb'
|
data/.rubocop_todo.yml
CHANGED
@@ -1,44 +1,132 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2021-04-02 12:44:05 UTC using RuboCop version 1.11.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count:
|
9
|
+
# Offense count: 1
|
10
|
+
# Configuration parameters: Include.
|
11
|
+
# Include: **/*.gemspec
|
12
|
+
Gemspec/RequiredRubyVersion:
|
13
|
+
Exclude:
|
14
|
+
- 'chewy.gemspec'
|
15
|
+
|
16
|
+
# Offense count: 2
|
17
|
+
# Configuration parameters: AllowedMethods.
|
18
|
+
# AllowedMethods: enums
|
19
|
+
Lint/ConstantDefinitionInBlock:
|
20
|
+
Exclude:
|
21
|
+
- 'lib/chewy/rspec/update_index.rb'
|
22
|
+
- 'spec/chewy/config_spec.rb'
|
23
|
+
|
24
|
+
# Offense count: 10
|
25
|
+
# Configuration parameters: AllowComments, AllowEmptyLambdas.
|
26
|
+
Lint/EmptyBlock:
|
27
|
+
Exclude:
|
28
|
+
- 'spec/chewy/minitest/helpers_spec.rb'
|
29
|
+
- 'spec/chewy/rspec/update_index_spec.rb'
|
30
|
+
- 'spec/chewy/search/scrolling_spec.rb'
|
31
|
+
- 'spec/chewy/strategy/atomic_spec.rb'
|
32
|
+
- 'spec/chewy/strategy_spec.rb'
|
33
|
+
- 'spec/chewy/index/import/bulk_request_spec.rb'
|
34
|
+
- 'spec/chewy/index/witchcraft_spec.rb'
|
35
|
+
- 'spec/chewy_spec.rb'
|
36
|
+
|
37
|
+
# Offense count: 3
|
38
|
+
Lint/MissingSuper:
|
39
|
+
Exclude:
|
40
|
+
- 'lib/chewy/strategy/atomic.rb'
|
41
|
+
- 'lib/chewy/index/adapter/object.rb'
|
42
|
+
- 'lib/chewy/index/adapter/orm.rb'
|
43
|
+
|
44
|
+
# Offense count: 35
|
45
|
+
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
|
10
46
|
Metrics/AbcSize:
|
11
|
-
Max:
|
47
|
+
Max: 41
|
12
48
|
|
13
49
|
# Offense count: 4
|
14
|
-
# Configuration parameters: CountComments.
|
50
|
+
# Configuration parameters: CountComments, CountAsOne.
|
15
51
|
Metrics/ClassLength:
|
16
|
-
Max:
|
52
|
+
Max: 267
|
17
53
|
|
18
|
-
# Offense count:
|
54
|
+
# Offense count: 13
|
55
|
+
# Configuration parameters: IgnoredMethods.
|
19
56
|
Metrics/CyclomaticComplexity:
|
20
|
-
Max:
|
21
|
-
|
22
|
-
# Offense count: 1450
|
23
|
-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
|
24
|
-
# URISchemes: http, https
|
25
|
-
Metrics/LineLength:
|
26
|
-
Max: 198
|
57
|
+
Max: 12
|
27
58
|
|
28
|
-
# Offense count:
|
29
|
-
# Configuration parameters: CountComments.
|
59
|
+
# Offense count: 43
|
60
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
30
61
|
Metrics/MethodLength:
|
31
|
-
Max:
|
62
|
+
Max: 29
|
32
63
|
|
33
|
-
# Offense count:
|
34
|
-
# Configuration parameters: CountComments.
|
64
|
+
# Offense count: 2
|
65
|
+
# Configuration parameters: CountComments, CountAsOne.
|
35
66
|
Metrics/ModuleLength:
|
36
|
-
Max:
|
67
|
+
Max: 158
|
37
68
|
|
38
|
-
# Offense count:
|
69
|
+
# Offense count: 18
|
70
|
+
# Configuration parameters: IgnoredMethods.
|
39
71
|
Metrics/PerceivedComplexity:
|
40
|
-
Max:
|
72
|
+
Max: 13
|
41
73
|
|
42
|
-
# Offense count:
|
74
|
+
# Offense count: 11
|
75
|
+
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
|
76
|
+
# SupportedStyles: snake_case, normalcase, non_integer
|
77
|
+
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
|
78
|
+
Naming/VariableNumber:
|
79
|
+
Exclude:
|
80
|
+
- 'spec/chewy/fields/root_spec.rb'
|
81
|
+
|
82
|
+
# Offense count: 5
|
83
|
+
Style/DocumentDynamicEvalDefinition:
|
84
|
+
Exclude:
|
85
|
+
- 'lib/chewy/index/actions.rb'
|
86
|
+
- 'lib/chewy/repository.rb'
|
87
|
+
- 'lib/chewy/search/pagination/kaminari.rb'
|
88
|
+
- 'lib/chewy/index/crutch.rb'
|
89
|
+
- 'lib/chewy/index/witchcraft.rb'
|
90
|
+
|
91
|
+
# Offense count: 58
|
43
92
|
Style/Documentation:
|
44
93
|
Enabled: false
|
94
|
+
|
95
|
+
# Offense count: 2
|
96
|
+
# Cop supports --auto-correct.
|
97
|
+
Style/EvalWithLocation:
|
98
|
+
Exclude:
|
99
|
+
- 'spec/chewy/index_spec.rb'
|
100
|
+
|
101
|
+
# Offense count: 191
|
102
|
+
# Cop supports --auto-correct.
|
103
|
+
# Configuration parameters: EnforcedStyle.
|
104
|
+
# SupportedStyles: always, always_true, never
|
105
|
+
Style/FrozenStringLiteralComment:
|
106
|
+
Enabled: false
|
107
|
+
|
108
|
+
# Offense count: 2
|
109
|
+
# Configuration parameters: MinBodyLength.
|
110
|
+
Style/GuardClause:
|
111
|
+
Exclude:
|
112
|
+
- 'lib/chewy.rb'
|
113
|
+
- 'spec/support/active_record.rb'
|
114
|
+
|
115
|
+
# Offense count: 10
|
116
|
+
# Cop supports --auto-correct.
|
117
|
+
Style/IfUnlessModifier:
|
118
|
+
Exclude:
|
119
|
+
- 'lib/chewy.rb'
|
120
|
+
- 'lib/chewy/railtie.rb'
|
121
|
+
- 'lib/chewy/rspec/update_index.rb'
|
122
|
+
- 'lib/chewy/search/query_proxy.rb'
|
123
|
+
- 'lib/chewy/index/import.rb'
|
124
|
+
- 'lib/chewy/index/witchcraft.rb'
|
125
|
+
- 'spec/support/active_record.rb'
|
126
|
+
|
127
|
+
# Offense count: 53
|
128
|
+
# Cop supports --auto-correct.
|
129
|
+
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
130
|
+
# URISchemes: http, https
|
131
|
+
Layout/LineLength:
|
132
|
+
Max: 191
|
data/CHANGELOG.md
CHANGED
@@ -8,6 +8,112 @@
|
|
8
8
|
|
9
9
|
### Bugs Fixed
|
10
10
|
|
11
|
+
## 7.2.3 (2021-10-29)
|
12
|
+
|
13
|
+
### New Features
|
14
|
+
|
15
|
+
* [#801](https://github.com/toptal/chewy/pull/801): Add the [`track_total_hits`](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-your-data.html#track-total-hits) option to the query. ([@milk1000cc][])
|
16
|
+
* [#810](https://github.com/toptal/chewy/pull/810): Use `unsafe_load` when loading config to support Psych 4.
|
17
|
+
* [#819](https://github.com/toptal/chewy/pull/819): Add the [`ignore_unavailable`](https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-index.html#multi-index) option to the request. ([@kolauren][])
|
18
|
+
|
19
|
+
### Changes
|
20
|
+
|
21
|
+
* [#817](https://github.com/toptal/chewy/pull/817): Show warning message during rake chewy:reset or chewy:upgrade if journaling is disabled. ([@konalegi][])
|
22
|
+
|
23
|
+
### Bugs Fixed
|
24
|
+
|
25
|
+
* [#816](https://github.com/toptal/chewy/pull/816): Move query [`preference`](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-search.html#search-preference) from body to query parameters. ([@afg419][])
|
26
|
+
|
27
|
+
## 7.2.2 (2021-05-24)
|
28
|
+
|
29
|
+
### Changes
|
30
|
+
|
31
|
+
* [#800](https://github.com/toptal/chewy/pull/800): Revert [#787](https://github.com/toptal/chewy/pull/787) progressbar feature to avoid performance degradation in parallel import ([@rabotyaga][])
|
32
|
+
|
33
|
+
* [#795](https://github.com/toptal/chewy/issues/795): **(Breaking)** Change the Chewy::Search::Parameters::Order implementation to use Array ([@jiajiawang][]):
|
34
|
+
* To allow multiple sorting options that may have the same key name. For example script based sorting whose key will always be `_script`.
|
35
|
+
* Behaviour change of chained `order` calls.
|
36
|
+
* e.g. `.order(_script: {a: 1}).order(_script: {b: 2})`
|
37
|
+
* Before `{:sort=>[{"_script"=>{:b=>2}}]}`
|
38
|
+
* After `{:sort=>[{"_script"=>{:a=>1}},{"_script"=>{:b=>2}}]}`
|
39
|
+
|
40
|
+
* [#654](https://github.com/toptal/chewy/issues/654): Add helpers and matchers for testing ([@Vitalina-Vakulchyk][]):
|
41
|
+
* `mock_elasticsearch_response` helpers both Rspec and Minitest - to mock elasticsearch response
|
42
|
+
* `mock_elasticsearch_response_sources` helpers both Rspec and Minitest - to mock elasticsearch response sources
|
43
|
+
* `assert_elasticsearch_query` helper for Minitest - to compare request and expected query (returns `true`/`false`)
|
44
|
+
* `build_query` matcher for Rspec - to compare request and expected query (returns `true`/`false`)
|
45
|
+
|
46
|
+
## 7.2.1 (2021-05-11)
|
47
|
+
|
48
|
+
### New Features
|
49
|
+
|
50
|
+
* [#469](https://github.com/toptal/chewy/issues/469): Add ability to output the progressbar with `ENV['PROGRESS']` during `reset` rake tasks ([@Vitalina-Vakulchyk][]):
|
51
|
+
* for `rake chewy:reset` and `rake chewy:parallel:reset`
|
52
|
+
* progressbar is hidden by default, set `ENV['PROGRESS']` to `true` to display it
|
53
|
+
|
54
|
+
### Bugs Fixed
|
55
|
+
|
56
|
+
* [#796](https://github.com/toptal/chewy/pull/796): Fix clear scroll: pass `scroll_id` in body, as passing in path parameters is deprecated and can overflow `http.max_initial_line_length` ([@rabotyaga][])
|
57
|
+
|
58
|
+
## 7.0.1 (2021-05-03)
|
59
|
+
|
60
|
+
### Changes
|
61
|
+
|
62
|
+
* [#792](https://github.com/toptal/chewy/pull/792): Skip ES version memoization for search requests ([@rabotyaga][])
|
63
|
+
* See the Migration Guide for details
|
64
|
+
|
65
|
+
## 7.2.0 (2021-04-19)
|
66
|
+
|
67
|
+
### New Features
|
68
|
+
|
69
|
+
* [#778](https://github.com/toptal/chewy/pull/778): Add `ignore_blank` option to `field` method ([@Vitalina-Vakulchyk][]):
|
70
|
+
* `true` by default for the `geo_point` type
|
71
|
+
* `false` by default for other types
|
72
|
+
|
73
|
+
### Changes
|
74
|
+
|
75
|
+
* [#783](https://github.com/toptal/chewy/pull/783): **(Breaking)** Remove `Chewy::Type`, simplify DSL ([@rabotyaga][])
|
76
|
+
* Remove the `Chewy::Type` class
|
77
|
+
* e.g. remove `CitiesIndex::City` / `CitiesIndex.city`
|
78
|
+
* `CitiesIndex::City.import! ...` becomes `CitiesIndex.import! ...`
|
79
|
+
* Simplify index DSL:
|
80
|
+
* `define_type` block -> `index_scope` clause
|
81
|
+
* it can be omitted completely, if you don't need to specify the scope or options, e.g. `name`
|
82
|
+
* Remove type names from string representations:
|
83
|
+
* in `update_index` ActiveRecord helper and RSpec matcher, e.g.
|
84
|
+
* `update_index('cities#city')` -> `update_index('cities')`
|
85
|
+
* `update_index(UsersIndex::User)` -> `update_index(UsersIndex)`
|
86
|
+
* in rake tasks (e.g. `rake chewy:update[cities#city]` -> `rake chewy:update[cities]`)
|
87
|
+
* in rake tasks output (e.g. `Imported CitiesIndex::City in 1s, stats: index 3` -> `Imported CitiesIndex in 1s, stats: index 3`)
|
88
|
+
* Use index name instead of type name in loader additional scope
|
89
|
+
* e.g. `CitiesIndex.filter(...).load(city: {scope: City.where(...)})` -> `CitiesIndex.filter(...).load(cities: {scope: City.where(...)})`
|
90
|
+
* [#692](https://github.com/toptal/chewy/issues/692): Add `.update_mapping` to Index class ([@Vitalina-Vakulchyk][]):
|
91
|
+
* Wrapped Elasticsearch gem `.put_mapping` with `.update_mapping` in Index class
|
92
|
+
* Add `rake chewy:update_mapping` task
|
93
|
+
* [#594](https://github.com/toptal/chewy/issues/594): Add `.reindex` to Index class ([@Vitalina-Vakulchyk][]):
|
94
|
+
* Wrapped Elasticsearch gem `.reindex` with `.reindex` in Index class
|
95
|
+
* Add `rake chewy:reindex` task
|
96
|
+
* [#679](https://github.com/toptal/chewy/issues/679): Wrapped `Elasticsearch::API::Indices::Actions#clear_cache` with `.clear_cache` in Index class ([@Vitalina-Vakulchyk][])
|
97
|
+
* [#495](https://github.com/toptal/chewy/issues/495): Ability to change Rails console strategy with `Chewy.console_strategy` ([@Vitalina-Vakulchyk][])
|
98
|
+
* [#778](https://github.com/toptal/chewy/pull/778): **(Breaking)** Drop support for Ruby 2.5 ([@Vitalina-Vakulchyk][])
|
99
|
+
* [#776](https://github.com/toptal/chewy/pull/776): **(Breaking)** Removal of unnecessary features and integrations ([@Vitalina-Vakulchyk][]):
|
100
|
+
* `aws-sdk-sqs` / `shoryuken`
|
101
|
+
* `mongoid`
|
102
|
+
* `sequel`
|
103
|
+
* `will_paginate`
|
104
|
+
* `resque`
|
105
|
+
* [#769](https://github.com/toptal/chewy/pull/769): **(Breaking)** Removal of deprecated methods and rake tasks ([@Vitalina-Vakulchyk][]):
|
106
|
+
* `Chewy::Index.index_params` is removed, use `Chewy::Index.specification_hash` instead
|
107
|
+
* `Chewy::Index.derivable_index_name` is removed, use `Chewy::Index.derivable_name` instead
|
108
|
+
* `Chewy::Index.default_prefix` is removed, use `Chewy::Index.prefix` instead
|
109
|
+
* `Chewy::Index.build_index_name` is removed, use `Chewy::Index.index_name` instead
|
110
|
+
* `Chewy::RakeHelper.reset_index` is removed, use `Chewy::RakeHelper.reset` instead
|
111
|
+
* `Chewy::RakeHelper.reset_all` is removed, use `Chewy::RakeHelper.reset` instead
|
112
|
+
* `Chewy::RakeHelper.update_index` is removed, use `Chewy::RakeHelper.update` instead
|
113
|
+
* `Chewy::RakeHelper.update_all` is removed, use `Chewy::RakeHelper.update` instead
|
114
|
+
* `rake chewy:apply_changes_from` is removed, use `rake chewy:journal:apply` instead
|
115
|
+
* `rake chewy:clean_journal` is removed, use `rake chewy:journal:clean` instead
|
116
|
+
|
11
117
|
## 7.1.0 (2021-03-03)
|
12
118
|
|
13
119
|
### Changes
|
@@ -531,6 +637,7 @@
|
|
531
637
|
[@aglushkov]: https://github.com/aglushkov
|
532
638
|
[@AlexVPopov]: https://github.com/AlexVPopov
|
533
639
|
[@AndreySavelyev]: https://github.com/AndreySavelyev
|
640
|
+
[@afg419]: https://github.com/afg419
|
534
641
|
[@arion]: https://github.com/arion
|
535
642
|
[@arturtr]: https://github.com/arturtr
|
536
643
|
[@averell23]: https://github.com/averell23
|
@@ -560,6 +667,7 @@
|
|
560
667
|
[@inbeom]: https://github.com/inbeom
|
561
668
|
[@jesjos]: https://github.com/jesjos
|
562
669
|
[@JF-Lalonde]: https://github.com/JF-Lalonde
|
670
|
+
[@jiajiawang]: https://github.com/jiajiawang
|
563
671
|
[@jimmybaker]: https://github.com/jimmybaker
|
564
672
|
[@jirikolarik]: https://github.com/jirikolarik
|
565
673
|
[@jirutka]: https://github.com/jirutka
|
@@ -570,6 +678,7 @@
|
|
570
678
|
[@josephchoe]: https://github.com/josephchoe
|
571
679
|
[@jshirley]: https://github.com/jshirley
|
572
680
|
[@ka8725]: https://github.com/ka8725
|
681
|
+
[@kolauren]: https://github.com/kolauren
|
573
682
|
[@konalegi]: https://github.com/konalegi
|
574
683
|
[@lardawge]: https://github.com/lardawge
|
575
684
|
[@leemhenson]: https://github.com/leemhenson
|
@@ -583,6 +692,7 @@
|
|
583
692
|
[@mattzollinhofer]: https://github.com/mattzollinhofer
|
584
693
|
[@menglewis]: https://github.com/menglewis
|
585
694
|
[@mikeyhogarth]: https://github.com/mikeyhogarth
|
695
|
+
[@milk1000cc]: https://github.com/milk1000cc
|
586
696
|
[@mkcode]: https://github.com/mkcode
|
587
697
|
[@mpeychich]: https://github.com/mpeychich
|
588
698
|
[@mrbrdo]: https://github.com/mrbrdo
|
@@ -607,5 +717,7 @@
|
|
607
717
|
[@taylor-au]: https://github.com/taylor-au
|
608
718
|
[@TikiTDO]: https://github.com/TikiTDO
|
609
719
|
[@undr]: https://github.com/undr
|
720
|
+
[@Vitalina-Vakulchyk]: https://github.com/Vitalina-Vakulchyk
|
610
721
|
[@webgago]: https://github.com/webgago
|
611
722
|
[@yahooguntu]: https://github.com/yahooguntu
|
723
|
+
|
data/Gemfile
CHANGED
@@ -3,18 +3,11 @@ source 'https://rubygems.org'
|
|
3
3
|
gemspec
|
4
4
|
|
5
5
|
gem 'activerecord'
|
6
|
-
# gem 'mongoid'
|
7
|
-
# gem 'sequel'
|
8
6
|
|
9
7
|
gem 'activejob', require: false
|
10
|
-
gem 'resque', require: false
|
11
8
|
gem 'sidekiq', require: false
|
12
9
|
|
13
|
-
gem 'aws-sdk-sqs', require: false
|
14
|
-
gem 'shoryuken', require: false
|
15
|
-
|
16
10
|
gem 'kaminari-core', require: false
|
17
|
-
gem 'will_paginate', require: false
|
18
11
|
|
19
12
|
gem 'parallel', require: false
|
20
13
|
gem 'ruby-progressbar', require: false
|
data/Guardfile
CHANGED
@@ -9,7 +9,9 @@ guard :rspec, cmd: 'rspec' do
|
|
9
9
|
# Rails example
|
10
10
|
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
11
11
|
watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
12
|
-
watch(%r{^app/controllers/(.+)_(controller)\.rb$})
|
12
|
+
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) do |m|
|
13
|
+
["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"]
|
14
|
+
end
|
13
15
|
watch(%r{^spec/support/(.+)\.rb$}) { 'spec' }
|
14
16
|
watch('config/routes.rb') { 'spec/routing' }
|
15
17
|
watch('app/controllers/application_controller.rb') { 'spec/controllers' }
|