chewy 5.0.0 → 7.1.0

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