chewy 0.10.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +240 -0
  3. data/.rubocop.yml +25 -25
  4. data/Appraisals +12 -10
  5. data/CHANGELOG.md +252 -263
  6. data/Gemfile +5 -1
  7. data/LICENSE.txt +1 -1
  8. data/README.md +142 -78
  9. data/chewy.gemspec +10 -12
  10. data/gemfiles/{rails.4.2.mongoid.5.1.gemfile → rails.5.2.activerecord.gemfile} +6 -4
  11. data/gemfiles/{rails.4.2.activerecord.gemfile → rails.5.2.mongoid.6.4.gemfile} +6 -4
  12. data/gemfiles/{rails.4.0.activerecord.gemfile → rails.6.0.activerecord.gemfile} +6 -3
  13. data/gemfiles/rails.6.1.activerecord.gemfile +19 -0
  14. data/gemfiles/sequel.4.45.gemfile +2 -2
  15. data/lib/chewy.rb +2 -1
  16. data/lib/chewy/backports/duplicable.rb +1 -1
  17. data/lib/chewy/config.rb +10 -39
  18. data/lib/chewy/fields/base.rb +40 -28
  19. data/lib/chewy/fields/root.rb +18 -11
  20. data/lib/chewy/index.rb +3 -1
  21. data/lib/chewy/index/actions.rb +27 -15
  22. data/lib/chewy/index/settings.rb +2 -0
  23. data/lib/chewy/index/specification.rb +12 -10
  24. data/lib/chewy/minitest/helpers.rb +6 -6
  25. data/lib/chewy/minitest/search_index_receiver.rb +17 -17
  26. data/lib/chewy/multi_search.rb +62 -0
  27. data/lib/chewy/railtie.rb +4 -4
  28. data/lib/chewy/rake_helper.rb +5 -5
  29. data/lib/chewy/rspec/update_index.rb +3 -5
  30. data/lib/chewy/search.rb +4 -11
  31. data/lib/chewy/search/loader.rb +1 -1
  32. data/lib/chewy/search/pagination/will_paginate.rb +4 -2
  33. data/lib/chewy/search/parameters.rb +24 -6
  34. data/lib/chewy/search/parameters/allow_partial_search_results.rb +27 -0
  35. data/lib/chewy/search/parameters/concerns/query_storage.rb +4 -3
  36. data/lib/chewy/search/parameters/indices.rb +123 -0
  37. data/lib/chewy/search/parameters/none.rb +1 -3
  38. data/lib/chewy/search/request.rb +100 -74
  39. data/lib/chewy/search/scrolling.rb +7 -6
  40. data/lib/chewy/stash.rb +30 -21
  41. data/lib/chewy/strategy/active_job.rb +1 -1
  42. data/lib/chewy/strategy/atomic.rb +1 -1
  43. data/lib/chewy/strategy/sidekiq.rb +1 -1
  44. data/lib/chewy/type.rb +5 -2
  45. data/lib/chewy/type/adapter/active_record.rb +1 -1
  46. data/lib/chewy/type/adapter/base.rb +9 -9
  47. data/lib/chewy/type/adapter/mongoid.rb +2 -4
  48. data/lib/chewy/type/adapter/orm.rb +7 -4
  49. data/lib/chewy/type/adapter/sequel.rb +5 -7
  50. data/lib/chewy/type/crutch.rb +1 -1
  51. data/lib/chewy/type/import.rb +13 -11
  52. data/lib/chewy/type/import/bulk_builder.rb +1 -1
  53. data/lib/chewy/type/import/bulk_request.rb +4 -2
  54. data/lib/chewy/type/import/journal_builder.rb +3 -3
  55. data/lib/chewy/type/import/routine.rb +3 -3
  56. data/lib/chewy/type/mapping.rb +42 -36
  57. data/lib/chewy/type/observe.rb +16 -12
  58. data/lib/chewy/type/syncer.rb +15 -14
  59. data/lib/chewy/type/witchcraft.rb +11 -7
  60. data/lib/chewy/type/wrapper.rb +14 -4
  61. data/lib/chewy/version.rb +1 -1
  62. data/lib/sequel/plugins/chewy_observe.rb +4 -19
  63. data/migration_guide.md +18 -0
  64. data/spec/chewy/config_spec.rb +16 -21
  65. data/spec/chewy/fields/base_spec.rb +70 -70
  66. data/spec/chewy/fields/root_spec.rb +56 -9
  67. data/spec/chewy/index/actions_spec.rb +63 -7
  68. data/spec/chewy/index/specification_spec.rb +25 -16
  69. data/spec/chewy/index_spec.rb +75 -45
  70. data/spec/chewy/journal_spec.rb +33 -29
  71. data/spec/chewy/minitest/search_index_receiver_spec.rb +11 -9
  72. data/spec/chewy/multi_search_spec.rb +85 -0
  73. data/spec/chewy/rake_helper_spec.rb +123 -95
  74. data/spec/chewy/rspec/update_index_spec.rb +47 -46
  75. data/spec/chewy/runtime_spec.rb +2 -2
  76. data/spec/chewy/search/pagination/kaminari_spec.rb +7 -3
  77. data/spec/chewy/search/pagination/will_paginate_spec.rb +9 -3
  78. data/spec/chewy/search/parameters/indices_spec.rb +190 -0
  79. data/spec/chewy/search/parameters/none_spec.rb +1 -1
  80. data/spec/chewy/search/parameters_spec.rb +21 -4
  81. data/spec/chewy/search/request_spec.rb +101 -70
  82. data/spec/chewy/search/response_spec.rb +27 -17
  83. data/spec/chewy/search/scrolling_spec.rb +25 -16
  84. data/spec/chewy/search_spec.rb +49 -35
  85. data/spec/chewy/stash_spec.rb +15 -13
  86. data/spec/chewy/strategy/active_job_spec.rb +15 -2
  87. data/spec/chewy/strategy/shoryuken_spec.rb +8 -2
  88. data/spec/chewy/strategy/sidekiq_spec.rb +6 -2
  89. data/spec/chewy/type/adapter/active_record_spec.rb +16 -4
  90. data/spec/chewy/type/import/bulk_builder_spec.rb +9 -94
  91. data/spec/chewy/type/import/journal_builder_spec.rb +17 -15
  92. data/spec/chewy/type/import_spec.rb +6 -0
  93. data/spec/chewy/type/mapping_spec.rb +51 -18
  94. data/spec/chewy/type/observe_spec.rb +4 -4
  95. data/spec/chewy/type/witchcraft_spec.rb +31 -0
  96. data/spec/chewy/type/wrapper_spec.rb +3 -1
  97. data/spec/chewy_spec.rb +0 -7
  98. data/spec/spec_helper.rb +5 -1
  99. data/spec/support/active_record.rb +20 -0
  100. metadata +46 -116
  101. data/.travis.yml +0 -53
  102. data/LEGACY_DSL.md +0 -497
  103. data/gemfiles/rails.4.1.activerecord.gemfile +0 -14
  104. data/gemfiles/rails.5.0.activerecord.gemfile +0 -15
  105. data/gemfiles/rails.5.0.mongoid.6.0.gemfile +0 -15
  106. data/gemfiles/rails.5.1.activerecord.gemfile +0 -15
  107. data/gemfiles/rails.5.1.mongoid.6.1.gemfile +0 -15
  108. data/lib/chewy/query.rb +0 -1098
  109. data/lib/chewy/query/compose.rb +0 -68
  110. data/lib/chewy/query/criteria.rb +0 -191
  111. data/lib/chewy/query/filters.rb +0 -227
  112. data/lib/chewy/query/loading.rb +0 -111
  113. data/lib/chewy/query/nodes/and.rb +0 -25
  114. data/lib/chewy/query/nodes/base.rb +0 -17
  115. data/lib/chewy/query/nodes/bool.rb +0 -34
  116. data/lib/chewy/query/nodes/equal.rb +0 -34
  117. data/lib/chewy/query/nodes/exists.rb +0 -20
  118. data/lib/chewy/query/nodes/expr.rb +0 -28
  119. data/lib/chewy/query/nodes/field.rb +0 -110
  120. data/lib/chewy/query/nodes/has_child.rb +0 -15
  121. data/lib/chewy/query/nodes/has_parent.rb +0 -15
  122. data/lib/chewy/query/nodes/has_relation.rb +0 -59
  123. data/lib/chewy/query/nodes/match_all.rb +0 -11
  124. data/lib/chewy/query/nodes/missing.rb +0 -20
  125. data/lib/chewy/query/nodes/not.rb +0 -25
  126. data/lib/chewy/query/nodes/or.rb +0 -25
  127. data/lib/chewy/query/nodes/prefix.rb +0 -19
  128. data/lib/chewy/query/nodes/query.rb +0 -20
  129. data/lib/chewy/query/nodes/range.rb +0 -63
  130. data/lib/chewy/query/nodes/raw.rb +0 -15
  131. data/lib/chewy/query/nodes/regexp.rb +0 -35
  132. data/lib/chewy/query/nodes/script.rb +0 -20
  133. data/lib/chewy/query/pagination.rb +0 -25
  134. data/spec/chewy/query/criteria_spec.rb +0 -700
  135. data/spec/chewy/query/filters_spec.rb +0 -201
  136. data/spec/chewy/query/loading_spec.rb +0 -124
  137. data/spec/chewy/query/nodes/and_spec.rb +0 -12
  138. data/spec/chewy/query/nodes/bool_spec.rb +0 -14
  139. data/spec/chewy/query/nodes/equal_spec.rb +0 -32
  140. data/spec/chewy/query/nodes/exists_spec.rb +0 -18
  141. data/spec/chewy/query/nodes/has_child_spec.rb +0 -59
  142. data/spec/chewy/query/nodes/has_parent_spec.rb +0 -59
  143. data/spec/chewy/query/nodes/match_all_spec.rb +0 -11
  144. data/spec/chewy/query/nodes/missing_spec.rb +0 -16
  145. data/spec/chewy/query/nodes/not_spec.rb +0 -13
  146. data/spec/chewy/query/nodes/or_spec.rb +0 -12
  147. data/spec/chewy/query/nodes/prefix_spec.rb +0 -16
  148. data/spec/chewy/query/nodes/query_spec.rb +0 -12
  149. data/spec/chewy/query/nodes/range_spec.rb +0 -32
  150. data/spec/chewy/query/nodes/raw_spec.rb +0 -11
  151. data/spec/chewy/query/nodes/regexp_spec.rb +0 -43
  152. data/spec/chewy/query/nodes/script_spec.rb +0 -15
  153. data/spec/chewy/query/pagination/kaminari_spec.rb +0 -5
  154. data/spec/chewy/query/pagination/will_paginate_spec.rb +0 -5
  155. data/spec/chewy/query/pagination_spec.rb +0 -39
  156. data/spec/chewy/query_spec.rb +0 -636
  157. data/spec/chewy/search/parameters/indices_boost_spec.rb +0 -83
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d7aa20726080ec98870f97d0c0ef730a3eb7bc4f
4
- data.tar.gz: 66b15afd916e7ed479bf7e9bacc3286a9ce9dc25
2
+ SHA256:
3
+ metadata.gz: 0d885732170ee400be6fc8df2f567afb384e752235edaf57ae58624f6907fb0d
4
+ data.tar.gz: 9d1aa6212b67c16a3e6cb7e4fec7c9b76ac768099d0717fbe97f16c1930584af
5
5
  SHA512:
6
- metadata.gz: 5800f28ff7480f5c7052c5860a5b3f3e6547ebee02e88f82d59e4aa2df6764d3330ee5c00ee3b36cff26c74ebec5d3713641868618d465718c6c615bae12ef85
7
- data.tar.gz: eb17d5fa79ec63472fdb0adac109d8612af6a9693bcda2afe05efe20f32b9d221933403049ba27731a9410752e6c955e522fceab4e7d6c372b38b64f21d87708
6
+ metadata.gz: 4c1809614999dc9c8e8f4ac0763e4aca663fa7f118bc4cedf17f7bef255f8161b19cfc94daeb34dfb2729dc68756726f647013ce63bc77d9596255b07b153239
7
+ data.tar.gz: 73ad27cef56399d39974d837eb374279f1a9cbd84e6103c9d4aba6e151d0200f3b63075056b6ebff02e9c7d06bda1bd3ea4ab736e683cb60353b537da52757ea
@@ -0,0 +1,240 @@
1
+ # Check https://circleci.com/docs/2.0/language-ruby/ for more details
2
+ version: 2.1
3
+
4
+ es-env: &es-env
5
+ cluster.name: elasticsearch
6
+ transport.host: localhost
7
+ network.host: 127.0.0.1
8
+ http.port: 9250
9
+ discovery.type: single-node
10
+ xpack.security.enabled: false
11
+ xpack.monitoring.enabled: false
12
+
13
+ workflows:
14
+ build:
15
+ jobs:
16
+ - rubocop
17
+ - rspec-ruby-26-activerecord61
18
+ - rspec-ruby-26-activerecord60
19
+ - rspec-ruby-26-activerecord52
20
+ - rspec-ruby-26-mongoid
21
+ - rspec-ruby-27-activerecord61
22
+ - rspec-ruby-27-activerecord60
23
+ - rspec-ruby-27-activerecord52
24
+ - rspec-ruby-27-mongoid
25
+ - rspec-ruby-30-activerecord61
26
+ - rspec-ruby-27-activerecord61-es6
27
+ - rspec-ruby-30-activerecord61-es6
28
+
29
+ commands:
30
+ rspec-test:
31
+ description: Test rspec in current ruby
32
+ parameters:
33
+ pre-steps:
34
+ description: Necessary steps after checkout
35
+ type: steps
36
+ default: []
37
+ steps:
38
+ - checkout
39
+ - run:
40
+ name: ruby version
41
+ command: |
42
+ ruby -e "STDERR.puts RUBY_VERSION; puts RUBY_VERSION.gsub(/^(\d+)\.(\d+)\..*/, '\1_\2')" > .ruby.version
43
+ - run:
44
+ name: Gemfile.lock version
45
+ command: |
46
+ echo "$GEMFILE.lock" > .Gemfile.lock.path
47
+ - steps: << parameters.pre-steps >>
48
+ - restore_cache:
49
+ keys:
50
+ - dependencies-{{ checksum ".ruby.version" }}-{{ checksum ".Gemfile.lock.path" }}
51
+ - run:
52
+ name: install dependencies
53
+ command: |
54
+ bundle install --jobs=4 --retry=3 --path vendor/bundle --gemfile=$GEMFILE
55
+ - save_cache:
56
+ paths:
57
+ - ./vendor/bundle
58
+ key: dependencies-{{ checksum ".ruby.version" }}-{{ checksum ".Gemfile.lock.path" }}
59
+ - run:
60
+ name: Disable replication of elastic indices
61
+ command: |
62
+ curl -XPUT 'http://localhost:9250/_all/_settings?preserve_existing=true' -d '{
63
+ "index.number_of_replicas":"0"
64
+ }'
65
+ - run:
66
+ name: run tests
67
+ command: |
68
+ ruby -v
69
+ git config --global user.email "you@example.com"
70
+ git config --global user.name "Your Name"
71
+ mkdir /tmp/test-results
72
+ TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
73
+ BUNDLE_GEMFILE=$GEMFILE bundle exec rspec --format progress --format RspecJunitFormatter --out /tmp/test-results/rspec.xml $TEST_FILES
74
+ - store_test_results:
75
+ path: /tmp/test-results
76
+
77
+ jobs:
78
+ rubocop:
79
+ docker:
80
+ - image: circleci/ruby:2.6
81
+ working_directory: ~/repo
82
+ steps:
83
+ - checkout
84
+ - run:
85
+ name: ruby version
86
+ command: |
87
+ ruby -e "STDERR.puts RUBY_VERSION; puts RUBY_VERSION.gsub(/^(\d+)\.(\d+)\..*/, '\1_\2')" > .ruby.version
88
+ - run:
89
+ name: Gemfile.lock version
90
+ command: |
91
+ echo "$GEMFILE.lock" > .Gemfile.lock.path
92
+ - restore_cache:
93
+ keys:
94
+ - dependencies-{{ checksum ".ruby.version" }}-{{ checksum ".Gemfile.lock.path" }}
95
+ - run:
96
+ name: install dependencies
97
+ command: |
98
+ bundle install --jobs=4 --retry=3 --path vendor/bundle --binstubs=/usr/local/bundle/bin
99
+ - save_cache:
100
+ paths:
101
+ - ./vendor/bundle
102
+ key: dependencies-{{ checksum ".ruby.version" }}-{{ checksum ".Gemfile.lock.path" }}
103
+ - run:
104
+ name: run rubocop
105
+ command: |
106
+ bundle exec rubocop --format simple
107
+
108
+ rspec-ruby-26-activerecord52:
109
+ docker:
110
+ - image: circleci/ruby:2.6
111
+ - image: docker.elastic.co/elasticsearch/elasticsearch:5.6.7
112
+ environment:
113
+ <<: *es-env
114
+ working_directory: ~/repo
115
+ environment:
116
+ GEMFILE: gemfiles/rails.5.2.activerecord.gemfile
117
+ steps:
118
+ - rspec-test
119
+
120
+ rspec-ruby-26-activerecord60:
121
+ docker:
122
+ - image: circleci/ruby:2.6
123
+ - image: docker.elastic.co/elasticsearch/elasticsearch:5.6.7
124
+ environment:
125
+ <<: *es-env
126
+ working_directory: ~/repo
127
+ environment:
128
+ GEMFILE: gemfiles/rails.6.0.activerecord.gemfile
129
+ steps:
130
+ - rspec-test
131
+
132
+ rspec-ruby-26-activerecord61:
133
+ docker:
134
+ - image: circleci/ruby:2.6
135
+ - image: docker.elastic.co/elasticsearch/elasticsearch:5.6.7
136
+ environment:
137
+ <<: *es-env
138
+ working_directory: ~/repo
139
+ environment:
140
+ GEMFILE: gemfiles/rails.6.1.activerecord.gemfile
141
+ steps:
142
+ - rspec-test
143
+
144
+ rspec-ruby-26-mongoid:
145
+ docker:
146
+ - image: circleci/ruby:2.6
147
+ - image: circleci/mongo:4.2.5
148
+ - image: docker.elastic.co/elasticsearch/elasticsearch:5.6.7
149
+ environment:
150
+ <<: *es-env
151
+ working_directory: ~/repo
152
+ environment:
153
+ GEMFILE: gemfiles/rails.5.2.mongoid.6.4.gemfile
154
+ steps:
155
+ - rspec-test
156
+
157
+ rspec-ruby-27-activerecord52:
158
+ docker:
159
+ - image: circleci/ruby:2.7
160
+ - image: docker.elastic.co/elasticsearch/elasticsearch:5.6.7
161
+ environment:
162
+ <<: *es-env
163
+ working_directory: ~/repo
164
+ environment:
165
+ GEMFILE: gemfiles/rails.5.2.activerecord.gemfile
166
+ steps:
167
+ - rspec-test
168
+
169
+ rspec-ruby-27-activerecord60:
170
+ docker:
171
+ - image: circleci/ruby:2.7
172
+ - image: docker.elastic.co/elasticsearch/elasticsearch:5.6.7
173
+ environment:
174
+ <<: *es-env
175
+ working_directory: ~/repo
176
+ environment:
177
+ GEMFILE: gemfiles/rails.6.0.activerecord.gemfile
178
+ steps:
179
+ - rspec-test
180
+
181
+ rspec-ruby-27-activerecord61:
182
+ docker:
183
+ - image: circleci/ruby:2.7
184
+ - image: docker.elastic.co/elasticsearch/elasticsearch:5.6.7
185
+ environment:
186
+ <<: *es-env
187
+ working_directory: ~/repo
188
+ environment:
189
+ GEMFILE: gemfiles/rails.6.1.activerecord.gemfile
190
+ steps:
191
+ - rspec-test
192
+
193
+ rspec-ruby-27-mongoid:
194
+ docker:
195
+ - image: circleci/ruby:2.7
196
+ - image: circleci/mongo:4.2.5
197
+ - image: docker.elastic.co/elasticsearch/elasticsearch:5.6.7
198
+ environment:
199
+ <<: *es-env
200
+ working_directory: ~/repo
201
+ environment:
202
+ GEMFILE: gemfiles/rails.5.2.mongoid.6.4.gemfile
203
+ steps:
204
+ - rspec-test
205
+
206
+ rspec-ruby-30-activerecord61:
207
+ docker:
208
+ - image: circleci/ruby:3.0
209
+ - image: docker.elastic.co/elasticsearch/elasticsearch:5.6.7
210
+ environment:
211
+ <<: *es-env
212
+ working_directory: ~/repo
213
+ environment:
214
+ GEMFILE: gemfiles/rails.6.1.activerecord.gemfile
215
+ steps:
216
+ - rspec-test
217
+
218
+ rspec-ruby-27-activerecord61-es6:
219
+ docker:
220
+ - image: circleci/ruby:2.7
221
+ - image: docker.elastic.co/elasticsearch/elasticsearch:6.8.13
222
+ environment:
223
+ <<: *es-env
224
+ working_directory: ~/repo
225
+ environment:
226
+ GEMFILE: gemfiles/rails.6.1.activerecord.gemfile
227
+ steps:
228
+ - rspec-test
229
+
230
+ rspec-ruby-30-activerecord61-es6:
231
+ docker:
232
+ - image: circleci/ruby:3.0
233
+ - image: docker.elastic.co/elasticsearch/elasticsearch:6.8.13
234
+ environment:
235
+ <<: *es-env
236
+ working_directory: ~/repo
237
+ environment:
238
+ GEMFILE: gemfiles/rails.6.1.activerecord.gemfile
239
+ steps:
240
+ - rspec-test
data/.rubocop.yml CHANGED
@@ -1,50 +1,50 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
- Lint/AmbiguousBlockAssociation:
4
- Enabled: false
5
-
6
- Lint/EndAlignment:
7
- EnforcedStyleAlignWith: variable
8
-
9
- Style/AccessModifierIndentation:
3
+ Layout/AccessModifierIndentation:
10
4
  EnforcedStyle: outdent
11
5
 
12
- Style/Alias:
13
- EnforcedStyle: prefer_alias_method
14
-
15
- Style/AlignHash:
6
+ Layout/AlignHash:
16
7
  EnforcedLastArgumentHashStyle: always_ignore
17
8
 
18
- Style/AlignParameters:
9
+ Layout/AlignParameters:
19
10
  EnforcedStyle: with_fixed_indentation
20
11
 
21
- Style/AndOr:
22
- EnforcedStyle: conditionals
23
-
24
- Style/CaseIndentation:
12
+ Layout/CaseIndentation:
25
13
  EnforcedStyle: end
26
14
 
27
- Style/DoubleNegation:
28
- Enabled: false
29
-
30
- Style/IndentArray:
15
+ Layout/IndentArray:
31
16
  EnforcedStyle: consistent
32
17
 
33
- Style/IndentHash:
18
+ Layout/IndentHash:
34
19
  EnforcedStyle: consistent
35
20
 
36
- Style/IndentHeredoc:
21
+ Layout/IndentHeredoc:
37
22
  Enabled: false
38
23
 
39
- Style/MultilineMethodCallIndentation:
24
+ Layout/MultilineMethodCallIndentation:
40
25
  EnforcedStyle: indented
41
26
 
42
- Style/MultilineOperationIndentation:
27
+ Layout/MultilineOperationIndentation:
43
28
  EnforcedStyle: indented
44
29
 
45
- Style/SpaceInsideHashLiteralBraces:
30
+ Layout/SpaceInsideHashLiteralBraces:
46
31
  EnforcedStyle: no_space
47
32
 
33
+ Lint/AmbiguousBlockAssociation:
34
+ Enabled: false
35
+
36
+ Lint/EndAlignment:
37
+ EnforcedStyleAlignWith: variable
38
+
39
+ Style/Alias:
40
+ EnforcedStyle: prefer_alias_method
41
+
42
+ Style/AndOr:
43
+ EnforcedStyle: conditionals
44
+
45
+ Style/DoubleNegation:
46
+ Enabled: false
47
+
48
48
  Metrics/BlockLength:
49
49
  Exclude:
50
50
  - '**/*_spec.rb'
data/Appraisals CHANGED
@@ -1,5 +1,3 @@
1
- # rubocop:disable Style/FileName
2
-
3
1
  %w[4.0 4.1 4.2].each do |activesupport|
4
2
  appraise "rails.#{activesupport}.activerecord" do
5
3
  gem 'activerecord', "~> #{activesupport}.0"
@@ -8,6 +6,7 @@
8
6
  gem 'activejob', "~> #{activesupport}.0" if activesupport >= '4.2'
9
7
  gem 'resque', require: false
10
8
  gem 'shoryuken', require: false
9
+ gem 'aws-sdk-sqs', require: false
11
10
  gem 'sidekiq', require: false
12
11
 
13
12
  gem 'kaminari', '~> 0.17.0', require: false
@@ -17,7 +16,7 @@
17
16
  end
18
17
  end
19
18
 
20
- %w[5.0 5.1].each do |activesupport|
19
+ %w[5.0 5.1 5.2].each do |activesupport|
21
20
  appraise "rails.#{activesupport}.activerecord" do
22
21
  gem 'activerecord', "~> #{activesupport}.0"
23
22
  gem 'activesupport', "~> #{activesupport}.0"
@@ -25,22 +24,24 @@ end
25
24
  gem 'activejob', "~> #{activesupport}.0"
26
25
  gem 'resque', require: false
27
26
  gem 'shoryuken', require: false
27
+ gem 'aws-sdk-sqs', require: false
28
28
  gem 'sidekiq', require: false
29
29
 
30
- gem 'kaminari-core', '~> 1.0.0', require: false
30
+ gem 'kaminari-core', '~> 1.1.0', require: false
31
31
  gem 'will_paginate', require: false
32
32
 
33
33
  gem 'parallel', require: false
34
34
  end
35
35
  end
36
36
 
37
- appraise 'rails.4.2.mongoid.5.1' do
38
- gem 'mongoid', '~> 5.1.0'
37
+ appraise 'rails.4.2.mongoid.5.2' do
38
+ gem 'mongoid', '~> 5.2.0'
39
39
  gem 'activesupport', '~> 4.2.0'
40
40
 
41
41
  gem 'activejob', '~> 4.2.0'
42
42
  gem 'resque', require: false
43
43
  gem 'shoryuken', require: false
44
+ gem 'aws-sdk-sqs', require: false
44
45
  gem 'sidekiq', require: false
45
46
 
46
47
  gem 'kaminari', '~> 0.17.0', require: false
@@ -49,7 +50,7 @@ appraise 'rails.4.2.mongoid.5.1' do
49
50
  gem 'parallel', require: false
50
51
  end
51
52
 
52
- {'5.0' => '6.0', '5.1' => '6.1'}.each do |activesupport, mongoid|
53
+ {'5.0' => '6.1', '5.1' => '6.3'}.each do |activesupport, mongoid|
53
54
  appraise "rails.#{activesupport}.mongoid.#{mongoid}" do
54
55
  gem 'mongoid', "~> #{mongoid}.0"
55
56
  gem 'activesupport', "~> #{activesupport}.0"
@@ -57,9 +58,10 @@ end
57
58
  gem 'activejob', "~> #{activesupport}.0"
58
59
  gem 'resque', require: false
59
60
  gem 'shoryuken', require: false
61
+ gem 'aws-sdk-sqs', require: false
60
62
  gem 'sidekiq', require: false
61
63
 
62
- gem 'kaminari-core', '~> 1.0.0', require: false
64
+ gem 'kaminari-core', '~> 1.1.0', require: false
63
65
  gem 'will_paginate', require: false
64
66
 
65
67
  gem 'parallel', require: false
@@ -69,9 +71,9 @@ end
69
71
  %w[4.45].each do |sequel|
70
72
  appraise "sequel.#{sequel}" do
71
73
  gem 'sequel', "~> #{sequel}.0"
72
- gem 'activesupport', '~> 5.0.0'
74
+ gem 'activesupport', '~> 5.1.0'
73
75
 
74
- gem 'kaminari-core', '~> 1.0.0', require: false
76
+ gem 'kaminari-core', '~> 1.1.0', require: false
75
77
  gem 'will_paginate', require: false
76
78
 
77
79
  gem 'parallel', require: false
data/CHANGELOG.md CHANGED
@@ -1,138 +1,177 @@
1
1
  # master
2
2
 
3
+ # Version 6.0.0 (2021-02-11)
4
+
3
5
  ## Breaking changes
4
6
 
5
- * Changed behavior of `Chewy::Index.index_name`, it doesn't cache the values anymore.
7
+ * [#743](https://github.com/toptal/chewy/pull/743): Elasticsearch 6.x support added. See [migration guide](migration_guide.md) & ES [breaking changes](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/breaking-changes-6.0.html). Removed legacy DSL support. Removed support for ES < 5 ([@mrzasa][], [@konalegi][], [@rabotyaga][])
6
8
 
7
- * Journal interfaces, related code and rake tasks were completely refactored and are not compatible with the previous version.
9
+ ## Bug fixes
8
10
 
9
- ## Changes
11
+ * [#695](https://github.com/toptal/chewy/pull/695): Clear the scroll by id after completing scroll_batches ([@socialchorus][])
12
+ * [#749](https://github.com/toptal/chewy/pull/749): Avoid importing everything when given an empty relation ([@JF-Lalonde][], [@dalthon][])
13
+ * [#736](https://github.com/toptal/chewy/pull/736): Fix nil children when using witchcraft ([@taylor-au][])
10
14
 
11
- * Parallel import and rake tasks.
15
+ ## Changes
12
16
 
13
- * `:shoryuken` async strategy (@josephchoe, #532)
17
+ * [#751](https://github.com/toptal/chewy/pull/751): Add [Multi Search API](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search-multi-search.html) support ([@mpeychich][], [@dalthon][])
18
+ * [#755](https://github.com/toptal/chewy/pull/755): `attribute_highlights` returns an array of highlights ([@musaffa][], [@dalthon][])
19
+ * [#753](https://github.com/toptal/chewy/pull/753): Add support for direct_import parameter to skip objects reloading ([@TikiTDO][], [@dalthon][])
20
+ * [#739](https://github.com/toptal/chewy/pull/739): Remove explicit `main` branch dependencies on rspec* gems after `rspec-mocks` 3.10.2 is released ([@rabotyaga][])
14
21
 
15
- * Deprecate `Chewy::Index.build_index_name`.
22
+ # Version 5.2.0 (2021-01-28)
16
23
 
17
- * Rename `Chewy::Index.default_prefix` to `Chewy::Index.prefix`. The old one is deprecated.
24
+ ## Changes
18
25
 
19
- * Add `Chewy::Type.derivable_name` for consistency.
26
+ * [#734](https://github.com/toptal/chewy/pull/734): Add support for Ruby 3 ([@lowang][])
27
+ * [#735](https://github.com/toptal/chewy/pull/735): Correct deprecation warning for Elasticsearch 5.6 to 6: empty query for`_delete_by_query`, delete by alias, `index_already_exists_exception` renaming ([@bhacaz][])
28
+ * [#733](https://github.com/toptal/chewy/pull/733): Update gemspec dependencies for Rails. Update CI gemfiles and matrix to tests against current LTS Rails versions. ([@bhacaz][])
29
+ * Tweak some wording and formatting; add a note about compatibility; update copyright; remove broken logo; update the CI badge ([@bbatsov][])
30
+ * [#714](https://github.com/toptal/chewy/pull/714): Update instructions for AWS ElasticSearch ([@olancheg][])
31
+ * [#728](https://github.com/toptal/chewy/pull/728): Fix more ruby 2.7 keyword params deprecation warnings ([@aglushkov][])
32
+ * [#715](https://github.com/toptal/chewy/pull/715): Fixed all deprecation warnings in Ruby 2.7 ([@gseddon][])
33
+ * [#718](https://github.com/toptal/chewy/pull/718): Added Ruby 2.7 to CircleCI config ([@mrzasa][])
34
+ * [#707](https://github.com/toptal/chewy/pull/707): Allow configuration of Active Job queue name ([@mrzasa][])
35
+ * [#711](https://github.com/toptal/chewy/pull/711): Setup CI on CircleCI ([@mrzasa][])
36
+ * [#710](https://github.com/toptal/chewy/pull/710): Fix deprecation warning for contructing new BigDecimal ([@AlexVPopov][])
20
37
 
21
- * Rename `Chewy::Index.derivable_index_name` to `Chewy::Index.derivable_name`.
22
- `Chewy::Index.derivable_index_name` and `Chewy::Type.derivable_index_name` are deprecated.
38
+ # Version 5.1.0 (2019-09-24)
23
39
 
24
- * Use normal YAML loading, for the config, we don't need the safe one.
40
+ ## Breaking changes
25
41
 
26
- * `default_root_options` option (@barthez, #526)
42
+ * [#657](https://github.com/toptal/chewy/pull/657): Add support for multiple indices in request ([@pyromaniac][])
43
+ * [#647](https://github.com/toptal/chewy/pull/647): Support `search_type`, `request_cache`, and `allow_partial_search_results` as query string parameters ([@mattzollinhofer][])
27
44
 
28
- * Partial indexing ability: it is possible to update only specified fields.
45
+ ## Changes
29
46
 
30
- * New cool `rake chewy:deploy` task.
47
+ * [#606](https://github.com/toptal/chewy/pull/606): Speed up imports when `bulk_size` is specified ([@yahooguntu][])
48
+ * [#682](https://github.com/toptal/chewy/pull/682): Insert `RequestStrategy` middleware before `ActionDispatch::ShowExceptions` ([@dck][])
31
49
 
32
- * Selective reset (resets only if necessary): `rake chewy:upgrade`.
50
+ # Version 5.0.0 (2018-02-13)
33
51
 
34
- * Consistency checks and synchronization: `rake chewy:sync`.
52
+ ## Breaking changes
35
53
 
36
- * Brand new request DSL. Supports ElasticSearch 2 and 5, better usability, architecture and docs.
54
+ * Try to align the gem version with the ElasticSearch version we support
55
+ * `Chewy.default_field_type` is `text` now.
56
+ * `Chewy::Stash` was split onto two indexes - `Chewy::Stash::Specification` and `Chewy::Stash::Journal`
57
+ * Data for journal and specification is stored in binary fields base64-encoded to bypass the limits of other fields.
58
+ * [#626](https://github.com/toptal/chewy/pull/626): Don't underscore suggested index name ([@dm1try][])
37
59
 
38
- * Add Kaminari 1.0 support.
60
+ ## Changes
39
61
 
40
- * `skip_index_creation_on_import` option (@sergey-kintsel, #483)
62
+ * [#598](https://github.com/toptal/chewy/pull/598): `pipeline` import option support ([@eManPrague][])
63
+ * [#625](https://github.com/toptal/chewy/pull/625): Proper Rails check ([@nattfodd][])
64
+ * [#623](https://github.com/toptal/chewy/pull/623): Bypass strategy performance improvements ([@DNNX][])
65
+ * [#620](https://github.com/toptal/chewy/pull/620): Avoid index update calls for empty data ([@robertasg][])
66
+ * Do not underscore suggested index name on `Chewy::Index.index_name` call.
67
+ * It is possible now to call `root` method several times inside a single type definition, the options will be merged. Also, the block isn't required anymore.
68
+ * [#565](https://github.com/toptal/chewy/pull/565): Fixed some Sequel deprecation warnings ([@arturtr][])
69
+ * [#577](https://github.com/toptal/chewy/pull/577): Fixed some Sequel deprecation warnings ([@matchbookmac][])
41
70
 
42
- * Ability to use procs for settings (@parallel588, #481)
71
+ ## Bugfixes
43
72
 
44
- * Bulk indexing optimizations with new additional options (@eproulx-petalmd, #467)
73
+ * [#593](https://github.com/toptal/chewy/pull/593): Fixed index settings logic error ([@yahooguntu][])
74
+ * [#567](https://github.com/toptal/chewy/pull/567): Missed check in higlight method ([@heartfulbird][])
45
75
 
46
- * Configurable sidekiq options (@averell23, #438)
47
-
48
- # Version 0.9.0
76
+ # Version 0.10.1
49
77
 
50
78
  ## Changes
51
79
 
52
- * Add `preference` param to Query (@menglewis, #443)
80
+ * [#558](https://github.com/toptal/chewy/pull/558): Improved parallel worker titles
53
81
 
54
- * Add the `track_scores` option to the query; `_score` to be computed and tracked even when there are no `_score` in sort. (@dmitry, #417)
82
+ ## Bugfixes
55
83
 
56
- * Confugurable `Chewy.indices_path` (@robacarp, #414, #433, #439)
84
+ * [#557](https://github.com/toptal/chewy/pull/557): Fixed request strategy initial debug message
85
+ * [#556](https://github.com/toptal/chewy/pull/556): Fixed will objects paginated array initialization when pagination was not used
86
+ * [#555](https://github.com/toptal/chewy/pull/555): Fixed fields symbol/string value
87
+ * [#554](https://github.com/toptal/chewy/pull/554): Fixed root field value proc
57
88
 
58
- * [Journaling](https://github.com/toptal/chewy/#journaling) implementation (@sergey-kintsel, #409, #425, #428, #432, #434, #463)
89
+ # Version 0.10.0
59
90
 
60
- * Minitest helpers (@robacarp, #396)
91
+ ## Breaking changes
61
92
 
62
- * `Chewy::Query#unlimited` to fetch all the documents (@sergey-kintsel, #393)
93
+ * Changed behavior of `Chewy::Index.index_name`, it doesn't cache the values anymore.
94
+ * Journal interfaces, related code and rake tasks were completely refactored and are not compatible with the previous version.
63
95
 
64
- * `Chewy::Query#exists?` (@sergey-kintsel, #386)
96
+ ## Changes
65
97
 
66
- * Import otimizations (#381, #376)
98
+ * [#543](https://github.com/toptal/chewy/pull/543): Less noisy strategies logging ([@Borzik][])
99
+ * Parallel import and the corresponding rake tasks.
100
+ * [#532](https://github.com/toptal/chewy/pull/532): `:shoryuken` async strategy ([@josephchoe][])
101
+ * Deprecate `Chewy::Index.build_index_name`.
102
+ * Rename `Chewy::Index.default_prefix` to `Chewy::Index.prefix`. The old one is deprecated.
103
+ * Add `Chewy::Type.derivable_name` for consistency.
104
+ * Rename `Chewy::Index.derivable_index_name` to `Chewy::Index.derivable_name`.
105
+ `Chewy::Index.derivable_index_name` and `Chewy::Type.derivable_index_name` are deprecated.
106
+ * Use normal YAML loading, for the config, we don't need the safe one.
107
+ * [#526](https://github.com/toptal/chewy/pull/526): `default_root_options` option ([@barthez][])
108
+ * Partial indexing ability: it is possible to update only specified fields.
109
+ * New cool `rake chewy:deploy` task.
110
+ * Selective reset (resets only if necessary): `rake chewy:upgrade`.
111
+ * Consistency checks and synchronization: `rake chewy:sync`.
112
+ * Brand new request DSL. Supports ElasticSearch 2 and 5, better usability, architecture and docs.
113
+ * Add Kaminari 1.0 support.
114
+ * [#483](https://github.com/toptal/chewy/pull/483): `skip_index_creation_on_import` option ([@sergey-kintsel][])
115
+ * [#481](https://github.com/toptal/chewy/pull/481): Ability to use procs for settings ([@parallel588][])
116
+ * [#467](https://github.com/toptal/chewy/pull/467): Bulk indexing optimizations with new additional options ([@eproulx-petalmd][])
117
+ * [#438](https://github.com/toptal/chewy/pull/438): Configurable sidekiq options ([@averell23][])
67
118
 
68
- * Additional import optimization technique - [raw import](https://github.com/toptal/chewy/#raw-import) (@DNNX, #375)
119
+ # Version 0.9.0
69
120
 
70
- * `weight` scoring dunction was added to the search DSL (@sevab, #380)
121
+ ## Changes
71
122
 
123
+ * [#443](https://github.com/toptal/chewy/pull/443): Add `preference` param to Query ([@menglewis][])
124
+ * [#417](https://github.com/toptal/chewy/pull/417): Add the `track_scores` option to the query; `_score` to be computed and tracked even when there are no `_score` in sort. ([@dmitry][])
125
+ * [#414](https://github.com/toptal/chewy/pull/414), [#433](https://github.com/toptal/chewy/pull/433), [#439](https://github.com/toptal/chewy/pull/439): Confugurable `Chewy.indices_path` ([@robacarp][])
126
+ * [#409](https://github.com/toptal/chewy/pull/409), [#425](https://github.com/toptal/chewy/pull/425), [#428](https://github.com/toptal/chewy/pull/428), [#432](https://github.com/toptal/chewy/pull/432), [#434](https://github.com/toptal/chewy/pull/434), [#463](https://github.com/toptal/chewy/pull/463): [Journaling](https://github.com/toptal/chewy/#journaling) implementation ([@sergey-kintsel][])
127
+ * [#396](https://github.com/toptal/chewy/pull/396): Minitest helpers ([@robacarp][])
128
+ * [#393](https://github.com/toptal/chewy/pull/393): `Chewy::Query#unlimited` to fetch all the documents ([@sergey-kintsel][])
129
+ * [#386](https://github.com/toptal/chewy/pull/386): `Chewy::Query#exists?` ([@sergey-kintsel][])
130
+ * [#381](https://github.com/toptal/chewy/pull/381), [#376](https://github.com/toptal/chewy/pull/376): Import otimizations
131
+ * [#375](https://github.com/toptal/chewy/pull/375): Additional import optimization technique - [raw import](https://github.com/toptal/chewy/#raw-import) ([@DNNX][])
132
+ * [#380](https://github.com/toptal/chewy/pull/380): `weight` scoring dunction was added to the search DSL ([@sevab][])
72
133
  * Rake tasks support multiple indexes and exceptions: `rake chewy:reset[users,projects]`, `rake chewy:update[-projects]`
73
-
74
134
  * Witchcraft™ supports dynamically generated procs with variables from closure.
75
-
76
- * Added `Query#preference` for specifying shard replicas to query against. (@menglewis)
135
+ * Added `Query#preference` for specifying shard replicas to query against. ([@menglewis][])
77
136
 
78
137
  ## Bugfixes
79
138
 
80
- * `.script_fields` method in the Index class (@dmitry, #415)
81
-
82
- * Fix routing_missing_exception on delete with parent missing (@guigs, #398)
83
-
84
- * Sequesl custom primary keys handling fix (@okliv, #385)
85
-
86
- * Bulk import fixes (@0x0badc0de, #374)
139
+ * [#415](https://github.com/toptal/chewy/pull/415): `.script_fields` method in the Index class ([@dmitry][])
140
+ * [#398](https://github.com/toptal/chewy/pull/398): Fix routing_missing_exception on delete with parent missing ([@guigs][])
141
+ * [#385](https://github.com/toptal/chewy/pull/385): Sequel custom primary keys handling fix ([@okliv][])
142
+ * [#374](https://github.com/toptal/chewy/pull/374): Bulk import fixes ([@0x0badc0de][])
87
143
 
88
144
  # Version 0.8.4
89
145
 
90
146
  ## Changes
91
147
 
92
148
  * Brand new import `:bulk_size` option, set desired ElasticSearch bulk size in bytes
93
-
94
149
  * Witchcraft™ technology
95
-
96
- * Configurable per-type default import options (@barthez, #341)
97
-
98
- * Various codebase optimizations (@DNNX, @pyromaniac)
99
-
150
+ * [#341](https://github.com/toptal/chewy/pull/341): Configurable per-type default import options ([@barthez][])
151
+ * Various codebase optimizations ([@DNNX][], [@pyromaniac][])
100
152
  * `update_index` Rspec matcher messages improvements
101
-
102
153
  * `:all` rake tasks deprecation
103
-
104
- * Scoped notification subscriptions in rake tasks (@0x0badc0de, #335)
105
-
106
- * Async strategies workers accept options (@dnd, #321)
107
-
108
- * Prefix is configurable per-index (@mikeyhogarth, #314)
109
-
110
- * Ability to pass proc for transport configuration (@feymartynov, @reidab, #302, #339)
111
-
112
- * ElasticSearch 2 support (@sergeygaychuk, #297)
113
-
154
+ * [#335](https://github.com/toptal/chewy/pull/335): Scoped notification subscriptions in rake tasks ([@0x0badc0de][])
155
+ * [#321](https://github.com/toptal/chewy/pull/321): Async strategies workers accept options ([@dnd][])
156
+ * [#314](https://github.com/toptal/chewy/pull/314): Prefix is configurable per-index ([@mikeyhogarth][])
157
+ * [#302](https://github.com/toptal/chewy/pull/302), [#339](https://github.com/toptal/chewy/pull/339): Ability to pass proc for transport configuration ([@feymartynov][], [@reidab][])
158
+ * [#297](https://github.com/toptal/chewy/pull/297): ElasticSearch 2 support ([@sergeygaychuk][])
114
159
  * Accessing types with methods is deprecated. Use `MyIndex::MyType` constant reference instead of `MyIndex.my_type` method.
115
-
116
- * Sequel adapter improvements (@mrbrdo, #294)
160
+ * [#294](https://github.com/toptal/chewy/pull/294): Sequel adapter improvements ([@mrbrdo][])
117
161
 
118
162
  ## Bugfixes
119
163
 
120
- * Mongoid atomic strategy fix (#325)
121
-
122
- * Method missing fix (@jesjos, #324)
123
-
124
- * Hash fields composition fix (@eproulx-petalmd, #319)
125
-
126
- * Better errors handling in strategies (@barthez, #306)
127
-
128
- * Assets strategies silencer fix for Rails 5 API mode (@clupprich, #303)
164
+ * [#325](https://github.com/toptal/chewy/pull/325): Mongoid atomic strategy fix
165
+ * [#324](https://github.com/toptal/chewy/pull/324): Method missing fix ([@jesjos][])
166
+ * [#319](https://github.com/toptal/chewy/pull/319): Hash fields composition fix ([@eproulx-petalmd][])
167
+ * [#306](https://github.com/toptal/chewy/pull/306): Better errors handling in strategies ([@barthez][])
168
+ * [#303](https://github.com/toptal/chewy/pull/303): Assets strategies silencer fix for Rails 5 API mode ([@clupprich][])
129
169
 
130
170
  # Version 0.8.3
131
171
 
132
172
  ## Breaking changes:
133
173
 
134
174
  * `Chewy.atomic` and `Chewy.urgent_update=` methods was removed from the codebase, use `Chewy.strategy` block instead.
135
-
136
175
  * `delete_from_index?` hook is removed from the codebase.
137
176
 
138
177
  ## Changes
@@ -142,37 +181,24 @@
142
181
  ## Bugfixes
143
182
 
144
183
  * Sequel objects transactional destruction fix
145
-
146
- * Correct Rspec mocking framework checking (@mainameiz)
147
-
184
+ * Correct Rspec mocking framework checking ([@mainameiz][])
148
185
  * Atomic strategy is now compatible with custom ids proc.
149
-
150
- * Safe unsubscribe on import (@marshall-lee)
151
-
152
- * Correct custom assets path silencer (@davekaro)
186
+ * Safe unsubscribe on import ([@marshall-lee][])
187
+ * Correct custom assets path silencer ([@davekaro][])
153
188
 
154
189
  # Version 0.8.2
155
190
 
156
191
  ## Changes
157
192
 
158
- * ActiveJob strategy by @mkcode
159
-
160
- * Async strategies tweak (@AndreySavelyev)
161
-
162
- * GeoPoint readme (@joonty)
163
-
164
- * Multiple grammar fixes and code improvements (@biow0lf)
165
-
166
- * Named aggregations by @caldwecr
167
-
168
- * Sequel adapter by @jirutka
169
-
170
- * Rake helper methods extracted (@caldwecr, @jirutka)
171
-
172
- * Multiple grammar fixes (@henrebotha)
173
-
174
- * Ability to pass a proc to `update_index` to define updating index dynamically (@SeTeM)
175
-
193
+ * ActiveJob strategy by [@mkcode][]
194
+ * Async strategies tweak ([@AndreySavelyev][])
195
+ * GeoPoint readme ([@joonty][])
196
+ * Multiple grammar fixes and code improvements ([@biow0lf][])
197
+ * Named aggregations by [@caldwecr][]
198
+ * Sequel adapter by [@jirutka][]
199
+ * Rake helper methods extracted ([@caldwecr][], [@jirutka][])
200
+ * Multiple grammar fixes ([@henrebotha][])
201
+ * Ability to pass a proc to `update_index` to define updating index dynamically ([@SeTeM][])
176
202
 
177
203
  ## Bugfixes
178
204
 
@@ -193,64 +219,39 @@
193
219
  ## Changes
194
220
 
195
221
  * Crutches™ technology
196
-
197
- * Added `.script_fields` chainable method to query (@ka8725)
198
-
199
- * `update_index` matcher mocha support (@lardawge)
200
-
222
+ * Added `.script_fields` chainable method to query ([@ka8725][])
223
+ * `update_index` matcher mocha support ([@lardawge][])
201
224
  * `:resque` async strategy
202
-
203
- * `:sidekiq` async strategy (inspired by @sharkzp)
204
-
205
- * Added `Query#search_type` for `search_type` request option setup (@marshall-lee)
225
+ * `:sidekiq` async strategy (inspired by [@sharkzp][])
226
+ * Added `Query#search_type` for `search_type` request option setup ([@marshall-lee][])
206
227
 
207
228
  ## Bugfixes
208
229
 
209
230
  * Rails 4.2 migrations are not raising UndefinedUpdateStrategy anymore on data updates
210
-
211
- * Mongoid random failing specs fixes (@marshall-lee)
231
+ * Mongoid random failing specs fixes ([@marshall-lee][])
212
232
 
213
233
  # Version 0.7.0
214
234
 
215
235
  ## Breaking changes:
216
236
 
217
- * `Chewy.use_after_commit_callbacks = false` returns previous RDBMS behavior
218
- in tests
219
-
237
+ * `Chewy.use_after_commit_callbacks = false` returns previous RDBMS behavior in tests
220
238
  * ActiveRecord import is now called after_commit instead of after_save and after_destroy
221
-
222
239
  * Import now respects default scope and removes unmatched documents
223
-
224
240
  * `delete_from_index?` method is deprecated, use
225
-
226
241
  ```ruby
227
242
  define_type User, delete_if: ->{ removed? } do
228
243
  ...
229
244
  end
230
245
  ```
231
-
232
246
  * `Chewy.request_strategy` to configure action controller's request wrapping strategy
233
-
234
247
  * `Chewy.root_strategy` to configure the first strategy in stack
235
-
236
248
  * Default strategy for controller actions is `:atomic`
237
-
238
249
  * Default strategy for activerecord migrations is `:bypass`
239
-
240
250
  * Default strategy for sandbox console is `:bypass`
241
-
242
251
  * Default strategy for rails console is `:urgent`
243
-
244
252
  * `Chewy.configuration` was renamed to `Chewy.settings`
245
-
246
- * Reworked index update strategies implementation. `Chewy.atomic`
247
- and `Chewy.urgent_update` are now deprecated in favour of the new
248
- `Chewy.strategy` API.
249
-
250
- * Loading objects for object-sourced types using `wrap` method is
251
- deprecated, `load_one` method should be used instead. Or method name
252
- might be passed to `define_type`:
253
-
253
+ * Reworked index update strategies implementation. `Chewy.atomic` and `Chewy.urgent_update` are now deprecated in favour of the new `Chewy.strategy` API.
254
+ * Loading objects for object-sourced types using `wrap` method is deprecated, `load_one` method should be used instead. Or method name might be passed to `define_type`:
254
255
  ```ruby
255
256
  class GeoData
256
257
  def self.get_data(elasticsearch_document)
@@ -266,12 +267,9 @@
266
267
 
267
268
  ## Changes
268
269
 
269
- * Multiple enhancements by @DNNX
270
-
271
- * Added `script_fields` to search criteria (@ka8725)
272
-
270
+ * Multiple enhancements by [@DNNX][]
271
+ * Added `script_fields` to search criteria ([@ka8725][])
273
272
  * ORM adapters now completely relies on the default scope. This means every scope or objects passed to import are merged with default scope so basically there is no need to define `delete_if` block. Default scope strongly restricts objects which may land in the current index.
274
-
275
273
  ```ruby
276
274
  define_type Country.where("rating > 30") do
277
275
 
@@ -284,11 +282,7 @@
284
282
  CountriesIndex::Country.import(Country.where("rating < 50").to_a)
285
283
  CountriesIndex::Country.import(Country.where("rating < 50").pluck(:id))
286
284
  ```
287
-
288
- * Object adapter supports custom initial import and load methods, so it
289
- could be configured to be used with procs or any class responding to `call`
290
- method.
291
-
285
+ * Object adapter supports custom initial import and load methods, so it could be configured to be used with procs or any class responding to `call` method.
292
286
  ```ruby
293
287
  class GeoData
294
288
  def self.call
@@ -301,9 +295,7 @@
301
295
  ...
302
296
  end
303
297
  ```
304
-
305
298
  * Nested fields value procs additional arguments: parent objects.
306
-
307
299
  ```ruby
308
300
  define_type Country do
309
301
  field :name
@@ -312,52 +304,44 @@
312
304
  end
313
305
  end
314
306
  ```
315
-
316
307
  * Implemented basic named scopes
317
308
 
318
309
  ## Bugfixes
319
310
 
320
- * `script_score` allow options (@joeljunstrom)
321
-
322
- * Chewy indexes eaged loading fixes (@leemhenson)
323
-
311
+ * `script_score` allow options ([@joeljunstrom][])
312
+ * Chewy indexes eaged loading fixes ([@leemhenson][])
324
313
  * `Chewy::Index.import nil` imports nothing instead of initial data
325
314
 
326
315
  # Version 0.6.2
327
316
 
328
317
  ## Changes
329
318
 
330
- * document root id custom value option (@baronworks)
319
+ * document root id custom value option ([@baronworks][])
331
320
 
332
321
  ## Bugfixes
333
322
 
334
- * Removed decay function defaults (@Linuus)
335
-
323
+ * Removed decay function defaults ([@Linuus][])
336
324
  * Correct config file handling in case of empty file
337
325
 
338
326
  # Version 0.6.1
339
327
 
340
328
  ## Changes
341
329
 
342
- * `min_score` query option support (@jshirley)
343
-
330
+ * `min_score` query option support ([@jshirley][])
344
331
  * `Chewy::Query#find` method for finding documents by id
345
332
 
346
333
  # Version 0.6.0
347
334
 
348
335
  ## Changes
349
336
 
350
- * Mongoid support YaY! (@fabiotomio, @leemhenson)
351
-
337
+ * Mongoid support YaY! ([@fabiotomio][], [@leemhenson][])
352
338
  * `urgent: true` option for `update_index` is deprecated and will be removed soon, use `Chewy.atomic` instead
353
-
354
- * `timeout` and `timed_out` support (@MarkMurphy)
355
-
356
- * will_paginate support (@josecoelho)
339
+ * `timeout` and `timed_out` support ([@MarkMurphy][])
340
+ * will_paginate support ([@josecoelho][])
357
341
 
358
342
  ## Bugfixes
359
343
 
360
- * All the query chainable methods delegated to indexes and types (partially @Linuus)
344
+ * All the query chainable methods delegated to indexes and types (partially [@Linuus][])
361
345
 
362
346
  # Version 0.5.2
363
347
 
@@ -371,118 +355,82 @@
371
355
 
372
356
  ## Bugfixes:
373
357
 
374
- * Advanced type classes resolving (@inbeom)
375
-
358
+ * Advanced type classes resolving ([@inbeom][])
376
359
  * `import` ignores nil
377
360
 
378
361
  # Version 0.5.1
379
362
 
380
363
  ## Changes:
381
364
 
382
- * `chewy.yml` Rails generator (@jirikolarik)
383
-
384
- * Parent-child mappings feature support (@inbeom)
385
-
365
+ * `chewy.yml` Rails generator ([@jirikolarik][])
366
+ * Parent-child mappings feature support ([@inbeom][])
386
367
  * `Chewy::Index.total_count` and `Chewy::Type::Base.total_count`
387
-
388
- * `Chewy::Type::Base.reset` method. Deletes all the type documents and performs import (@jondavidford)
389
-
390
- * Added `Chewy::Query#delete_all` scope method using delete by query ES feature (@jondavidford)
391
-
392
- * Rspec 3 `update_index` matcher support (@jimmybaker)
393
-
394
- * Implemented function scoring (@averell23)
368
+ * `Chewy::Type::Base.reset` method. Deletes all the type documents and performs import ([@jondavidford][])
369
+ * Added `Chewy::Query#delete_all` scope method using delete by query ES feature ([@jondavidford][])
370
+ * Rspec 3 `update_index` matcher support ([@jimmybaker][])
371
+ * Implemented function scoring ([@averell23][])
395
372
 
396
373
  ## Bugfixes:
397
374
 
398
- * Indexed eager-loading fix (@leemhenson)
399
-
400
- * Field type deriving nested type support fix (@rschellhorn)
375
+ * Indexed eager-loading fix ([@leemhenson][])
376
+ * Field type deriving nested type support fix ([@rschellhorn][])
401
377
 
402
378
  # Version 0.5.0
403
379
 
404
380
  ## Breaking changes:
405
381
 
406
382
  * 404 exception (IndexMissingException) while query is swallowed and treated like an empty result set.
407
-
408
383
  * `load` and `preload` for queries became lazy. Might be partially incompatible.
409
-
410
384
  * 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)
411
385
 
412
386
  ## Changes:
413
387
 
414
- * `suggest` query options support (@rschellhorn).
415
-
388
+ * `suggest` query options support ([@rschellhorn][]).
416
389
  * Added hash data support. How it is possible to pass hashes to import.
417
-
418
390
  * `rake chewy:reset` and `rake chewy:update` paramless acts as `rake chewy:reset:all` and `rake chewy:update:all` respectively
419
-
420
391
  * Added `delete_from_index?` API method for custom deleted objects marking.
421
-
422
392
  * Added `post_filter` API, working the same way as filters.
423
-
424
393
  * Added chainable `strategy` query method.
425
-
426
394
  * Aliasing is performed in index create request for ElasticSearch >= 1.1.
427
-
428
395
  * `preload` scope method loads ORM/ODM objects in background.
429
-
430
396
  * `load` method `:only` and `:except` options to specify load types.
431
-
432
397
  * `highlight` and `rescore` query options support.
433
-
434
398
  * config/chewy.yml ERB support.
435
399
 
436
400
  ## Bugfixes:
437
401
 
438
402
  * Fixed `missing` and `exists` filters DSL constructors.
439
-
440
403
  * Reworked index data composing.
441
-
442
- * Support for Kaminari new PaginatableArray behavior (@leemhenson)
443
-
404
+ * Support for Kaminari new PaginatableArray behavior ([@leemhenson][])
444
405
  * Correct waiting for status. After index creation, bulk import, and deletion.
445
-
446
- * Fix #23 "wrong constant name" with namespace models
406
+ * [#23](https://github.com/toptal/chewy/pull/23): Fix "wrong constant name" with namespace models
447
407
 
448
408
  # Version 0.4.0
449
409
 
450
410
  * Changed `update_index` matcher behavior. Now it compare array attributes position-independently.
451
-
452
- * Search aggregations API support (@arion).
453
-
411
+ * Search aggregations API support ([@arion][]).
454
412
  * Chewy::Query#facets called without params performs the request and returns facets.
455
-
456
413
  * Added `Type.template` DSL method for root objects dynamic templates definition. See [mapping.rb](lib/chewy/type/mapping.rb) for more details.
457
-
458
- * ActiveRecord adapter custom `primary_key` support (@matthee).
459
-
414
+ * ActiveRecord adapter custom `primary_key` support ([@matthee][]).
460
415
  * Urgent update now clears association cache in ActiveRecord to ensure latest changes are imported.
461
-
462
416
  * `import` now creates index before performing.
463
-
464
417
  * `Chewy.configuration[:wait_for_status]` option. Can be set to `red`, `yellow` or `green`. If set - chewy will wait for cluster status before creating, deleting index and import. Useful for specs.
465
418
 
466
419
  # Version 0.3.0
467
420
 
468
421
  * Added `Chewy.configuration[:index]` config to setup common indexes options.
469
-
470
422
  * `Chewy.client_options` replaced with `Chewy.configuration`
471
-
472
423
  * Using source filtering instead of fields filter (http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-source-filtering.html).
473
424
 
474
425
  # Version 0.2.3
475
426
 
476
427
  * `.import!` indexes method, raises import errors.
477
-
478
428
  * `.import!` types method, raises import errors. Useful for specs.
479
429
 
480
430
  # Version 0.2.2
481
431
 
482
- * Support for `none` scope (@undr).
483
-
484
- * Auto-resolved analyzers and analyzers repository (@webgago):
485
-
432
+ * Support for `none` scope ([@undr][]).
433
+ * Auto-resolved analyzers and analyzers repository ([@webgago][]):
486
434
  ```ruby
487
435
  # Setting up analyzers repository:
488
436
  Chewy.analyzer :title_analyzer, type: 'custom', filter: %w(lowercase icu_folding title_nysiis)
@@ -493,33 +441,22 @@
493
441
  settings analysis: {analyzer: ['title_analyzer', {one_more_analyzer: {type: 'custom', tokenizer: 'lowercase'}}]}
494
442
  end
495
443
  ```
496
-
497
444
  `title_analyzer` here will be automatically resolved and passed to index mapping
498
445
 
499
446
  # Version 0.2.0
500
447
 
501
448
  * 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.
502
-
503
449
  * `Chewy::Index.import` now takes types hash as argument within options hash:
504
450
 
505
451
  `PlacesIndex.import city: City.enabled, country: Country.enabled, refresh: false`
506
-
507
452
  * Old indexes cleanup after reset.
508
-
509
453
  * Added index prefixes.
510
-
511
454
  * `define_type` now takes options for adapter.
512
-
513
455
  * `chewy:reset` and `chewy:reset:all` rake tasks are now trying to reset index with zero downtime if it is possible.
514
-
515
456
  * Added `chewy:update:all` rake task.
516
-
517
457
  * 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.
518
-
519
458
  * Method `reset` renamed to `reset!`.
520
-
521
459
  * Added common loading scope for AR adapter. Also removed scope proc argument, now it executes just in main load scope context.
522
-
523
460
  `CitiesIndex.all.load(scope: {city: City.include(:country)})`
524
461
  `CitiesIndex.all.load(scope: {city: -> { include(:country) }})`
525
462
  `CitiesIndex.all.load(scope: ->{ include(:country) })`
@@ -527,35 +464,19 @@
527
464
  # Version 0.1.0
528
465
 
529
466
  * Added filters simplified DSL. See [filters.rb](lib/chewy/query/filters.rb) for more details.
530
-
531
467
  * Queries and filters join system reworked. See [query.rb](lib/chewy/query.rb) for more details.
532
-
533
468
  * Added query `merge` method
534
-
535
- * `update_index` matcher now wraps expected block in `Chewy.atomic` by default.
536
- This behaviour can be prevented with `atomic: false` option passing
537
-
469
+ * `update_index` matcher now wraps expected block in `Chewy.atomic` by default. This behaviour can be prevented with `atomic: false` option passing
538
470
  ```ruby
539
471
  expect { user.save! }.to update_index('users#user', atomic: false)
540
472
  ```
541
-
542
473
  * Renamed `Chewy.observing_enabled` to `Chewy.urgent_update` with `false` as default
543
-
544
- * `update_elasticsearch` renamed to `update_index`, added `update_index`
545
- `:urgent` option
546
-
547
- * Added import ActiveSupport::Notifications instrumentation
548
- `ActiveSupport::Notifications.subscribe('import_objects.chewy') { |*args| }`
549
-
550
- * Added `types!` and `only!` query chain methods, which purges previously
551
- chained types and fields
552
-
474
+ * `update_elasticsearch` renamed to `update_index`, added `update_index` `:urgent` option
475
+ * Added import ActiveSupport::Notifications instrumentation `ActiveSupport::Notifications.subscribe('import_objects.chewy') { |*args| }`
476
+ * Added `types!` and `only!` query chain methods, which purges previously chained types and fields
553
477
  * `types` chain method now uses types filter
554
-
555
478
  * Added `types` query chain method
556
-
557
479
  * Changed types access API:
558
-
559
480
  ```ruby
560
481
  UsersIndex::User # => UsersIndex::User
561
482
  UsersIndex::types_hash['user'] # => UsersIndex::User
@@ -563,37 +484,105 @@
563
484
  UsersIndex.types # => [UsersIndex::User]
564
485
  UsersIndex.type_names # => ['user']
565
486
  ```
566
-
567
487
  * `update_elasticsearch` method name as the second argument
568
488
 
569
489
  ```ruby
570
490
  update_elasticsearch('users#user', :self)
571
491
  update_elasticsearch('users#user', :users)
572
492
  ```
573
-
574
- * Changed index handle methods, removed `index_` prefix. I.e. was
575
- `UsersIndex.index_create`, became `UsersIndex.create`
576
-
577
- * Ability to pass value proc for source object context if arity == 0
578
- `field :full_name, value: ->{ first_name + last_name }` instead of
579
- `field :full_name, value: ->(u){ u.first_name + u.last_name }`
580
-
493
+ * Changed index handle methods, removed `index_` prefix. I.e. was `UsersIndex.index_create`, became `UsersIndex.create`
494
+ * Ability to pass value proc for source object context if arity == 0 `field :full_name, value: ->{ first_name + last_name }` instead of `field :full_name, value: ->(u){ u.first_name + u.last_name }`
581
495
  * Added `.only` chain to `update_index` matcher
582
-
583
- * Added ability to pass ActiveRecord::Relation as a scope for load
584
- `CitiesIndex.all.load(scope: {city: City.include(:country)})`
585
-
496
+ * Added ability to pass ActiveRecord::Relation as a scope for load `CitiesIndex.all.load(scope: {city: City.include(:country)})`
586
497
  * Added method `all` to index for query DSL consistency
587
-
588
498
  * Implemented isolated adapters to simplify adding new ORMs
589
-
590
- * Query DLS chainable methods delegated to index class
591
- (no longer need to call MyIndex.search.query, just MyIndex.query)
499
+ * Query DLS chainable methods delegated to index class (no longer need to call MyIndex.search.query, just MyIndex.query)
592
500
 
593
501
  # Version 0.0.1
594
502
 
595
503
  * Query DSL
596
-
597
504
  * Basic index handling
598
-
599
505
  * Initial version
506
+
507
+ [@0x0badc0de]: https://github.com/0x0badc0de
508
+ [@aglushkov]: https://github.com/aglushkov
509
+ [@AlexVPopov]: https://github.com/AlexVPopov
510
+ [@AndreySavelyev]: https://github.com/AndreySavelyev
511
+ [@arion]: https://github.com/arion
512
+ [@arturtr]: https://github.com/arturtr
513
+ [@averell23]: https://github.com/averell23
514
+ [@baronworks]: https://github.com/baronworks
515
+ [@barthez]: https://github.com/barthez
516
+ [@bbatsov]: https://github.com/bbatsov
517
+ [@bhacaz]: https://github.com/bhacaz
518
+ [@biow0lf]: https://github.com/biow0lf
519
+ [@Borzik]: https://github.com/Borzik
520
+ [@caldwecr]: https://github.com/caldwecr
521
+ [@clupprich]: https://github.com/clupprich
522
+ [@dalthon]: https://github.com/dalthon
523
+ [@davekaro]: https://github.com/davekaro
524
+ [@dck]: https://github.com/dck
525
+ [@dm1try]: https://github.com/dm1try
526
+ [@dmitry]: https://github.com/dmitry
527
+ [@dnd]: https://github.com/dnd
528
+ [@DNNX]: https://github.com/DNNX
529
+ [@eManPrague]: https://github.com/eManPrague
530
+ [@eproulx-petalmd]: https://github.com/eproulx-petalmd
531
+ [@fabiotomio]: https://github.com/fabiotomio
532
+ [@feymartynov]: https://github.com/feymartynov
533
+ [@gseddon]: https://github.com/gseddon
534
+ [@guigs]: https://github.com/guigs
535
+ [@heartfulbird]: https://github.com/heartfulbird
536
+ [@henrebotha]: https://github.com/henrebotha
537
+ [@inbeom]: https://github.com/inbeom
538
+ [@jesjos]: https://github.com/jesjos
539
+ [@JF-Lalonde]: https://github.com/JF-Lalonde
540
+ [@jimmybaker]: https://github.com/jimmybaker
541
+ [@jirikolarik]: https://github.com/jirikolarik
542
+ [@jirutka]: https://github.com/jirutka
543
+ [@joeljunstrom]: https://github.com/joeljunstrom
544
+ [@jondavidford]: https://github.com/jondavidford
545
+ [@joonty]: https://github.com/joonty
546
+ [@josecoelho]: https://github.com/josecoelho
547
+ [@josephchoe]: https://github.com/josephchoe
548
+ [@jshirley]: https://github.com/jshirley
549
+ [@ka8725]: https://github.com/ka8725
550
+ [@konalegi]: https://github.com/konalegi
551
+ [@lardawge]: https://github.com/lardawge
552
+ [@leemhenson]: https://github.com/leemhenson
553
+ [@Linuus]: https://github.com/Linuus
554
+ [@lowang]: https://github.com/lowang
555
+ [@mainameiz]: https://github.com/mainameiz
556
+ [@MarkMurphy]: https://github.com/MarkMurphy
557
+ [@marshall]: https://github.com/marshall
558
+ [@matchbookmac]: https://github.com/matchbookmac
559
+ [@matthee]: https://github.com/matthee
560
+ [@mattzollinhofer]: https://github.com/mattzollinhofer
561
+ [@menglewis]: https://github.com/menglewis
562
+ [@mikeyhogarth]: https://github.com/mikeyhogarth
563
+ [@mkcode]: https://github.com/mkcode
564
+ [@mpeychich]: https://github.com/mpeychich
565
+ [@mrbrdo]: https://github.com/mrbrdo
566
+ [@mrzasa]: https://github.com/mrzasa
567
+ [@musaffa]: https://github.com/musaffa
568
+ [@nattfodd]: https://github.com/nattfodd
569
+ [@okliv]: https://github.com/okliv
570
+ [@olancheg]: https://github.com/olancheg
571
+ [@parallel588]: https://github.com/parallel588
572
+ [@pyromaniac]: https://github.com/pyromaniac
573
+ [@rabotyaga]: https://github.com/rabotyaga
574
+ [@reidab]: https://github.com/reidab
575
+ [@robacarp]: https://github.com/robacarp
576
+ [@robertasg]: https://github.com/robertasg
577
+ [@rschellhorn]: https://github.com/rschellhorn
578
+ [@sergey-kintsel]: https://github.com/sergey-kintsel
579
+ [@sergeygaychuk]: https://github.com/sergeygaychuk
580
+ [@SeTeM]: https://github.com/SeTeM
581
+ [@sevab]: https://github.com/sevab
582
+ [@sharkzp]: https://github.com/sharkzp
583
+ [@socialchorus]: https://github.com/socialchorus
584
+ [@taylor-au]: https://github.com/taylor-au
585
+ [@TikiTDO]: https://github.com/TikiTDO
586
+ [@undr]: https://github.com/undr
587
+ [@webgago]: https://github.com/webgago
588
+ [@yahooguntu]: https://github.com/yahooguntu