chewy 0.8.4 → 7.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (340) hide show
  1. checksums.yaml +5 -5
  2. data/.github/CODEOWNERS +1 -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/.github/workflows/ruby.yml +74 -0
  7. data/.gitignore +1 -0
  8. data/.rubocop.yml +61 -0
  9. data/.rubocop_todo.yml +132 -0
  10. data/.yardopts +5 -0
  11. data/CHANGELOG.md +554 -245
  12. data/CODE_OF_CONDUCT.md +14 -0
  13. data/CONTRIBUTING.md +63 -0
  14. data/Gemfile +14 -11
  15. data/Guardfile +8 -6
  16. data/LICENSE.txt +1 -1
  17. data/README.md +748 -623
  18. data/Rakefile +11 -1
  19. data/chewy.gemspec +15 -19
  20. data/gemfiles/rails.5.2.activerecord.gemfile +11 -0
  21. data/gemfiles/rails.6.0.activerecord.gemfile +11 -0
  22. data/gemfiles/rails.6.1.activerecord.gemfile +13 -0
  23. data/gemfiles/rails.7.0.activerecord.gemfile +13 -0
  24. data/lib/chewy/config.rb +64 -50
  25. data/lib/chewy/errors.rb +10 -16
  26. data/lib/chewy/fields/base.rb +122 -32
  27. data/lib/chewy/fields/root.rb +48 -23
  28. data/lib/chewy/index/actions.rb +140 -54
  29. data/lib/chewy/index/adapter/active_record.rb +112 -0
  30. data/lib/chewy/{type → index}/adapter/base.rb +31 -12
  31. data/lib/chewy/index/adapter/object.rb +249 -0
  32. data/lib/chewy/index/adapter/orm.rb +194 -0
  33. data/lib/chewy/index/aliases.rb +14 -4
  34. data/lib/chewy/index/crutch.rb +40 -0
  35. data/lib/chewy/index/import/bulk_builder.rb +311 -0
  36. data/lib/chewy/index/import/bulk_request.rb +77 -0
  37. data/lib/chewy/index/import/journal_builder.rb +44 -0
  38. data/lib/chewy/index/import/routine.rb +139 -0
  39. data/lib/chewy/index/import.rb +243 -0
  40. data/lib/chewy/{type → index}/mapping.rb +79 -68
  41. data/lib/chewy/index/observe/active_record_methods.rb +87 -0
  42. data/lib/chewy/index/observe/callback.rb +34 -0
  43. data/lib/chewy/index/observe.rb +17 -0
  44. data/lib/chewy/index/settings.rb +10 -5
  45. data/lib/chewy/index/specification.rb +61 -0
  46. data/lib/chewy/index/syncer.rb +221 -0
  47. data/lib/chewy/{type → index}/witchcraft.rb +100 -39
  48. data/lib/chewy/index/wrapper.rb +95 -0
  49. data/lib/chewy/index.rb +216 -140
  50. data/lib/chewy/journal.rb +66 -0
  51. data/lib/chewy/log_subscriber.rb +8 -8
  52. data/lib/chewy/minitest/helpers.rb +150 -0
  53. data/lib/chewy/minitest/search_index_receiver.rb +76 -0
  54. data/lib/chewy/minitest.rb +1 -0
  55. data/lib/chewy/multi_search.rb +62 -0
  56. data/lib/chewy/railtie.rb +12 -25
  57. data/lib/chewy/rake_helper.rb +335 -37
  58. data/lib/chewy/repository.rb +2 -2
  59. data/lib/chewy/rspec/build_query.rb +12 -0
  60. data/lib/chewy/rspec/helpers.rb +55 -0
  61. data/lib/chewy/rspec/update_index.rb +106 -90
  62. data/lib/chewy/rspec.rb +3 -1
  63. data/lib/chewy/runtime/version.rb +4 -4
  64. data/lib/chewy/runtime.rb +1 -1
  65. data/lib/chewy/search/loader.rb +61 -0
  66. data/lib/chewy/{query → search}/pagination/kaminari.rb +13 -5
  67. data/lib/chewy/search/parameters/aggs.rb +16 -0
  68. data/lib/chewy/search/parameters/allow_partial_search_results.rb +27 -0
  69. data/lib/chewy/search/parameters/collapse.rb +16 -0
  70. data/lib/chewy/search/parameters/concerns/bool_storage.rb +24 -0
  71. data/lib/chewy/search/parameters/concerns/hash_storage.rb +23 -0
  72. data/lib/chewy/search/parameters/concerns/integer_storage.rb +14 -0
  73. data/lib/chewy/search/parameters/concerns/query_storage.rb +238 -0
  74. data/lib/chewy/search/parameters/concerns/string_array_storage.rb +23 -0
  75. data/lib/chewy/search/parameters/concerns/string_storage.rb +14 -0
  76. data/lib/chewy/search/parameters/docvalue_fields.rb +12 -0
  77. data/lib/chewy/search/parameters/explain.rb +16 -0
  78. data/lib/chewy/search/parameters/filter.rb +47 -0
  79. data/lib/chewy/search/parameters/highlight.rb +16 -0
  80. data/lib/chewy/search/parameters/ignore_unavailable.rb +27 -0
  81. data/lib/chewy/search/parameters/indices.rb +78 -0
  82. data/lib/chewy/search/parameters/indices_boost.rb +52 -0
  83. data/lib/chewy/search/parameters/limit.rb +17 -0
  84. data/lib/chewy/search/parameters/load.rb +32 -0
  85. data/lib/chewy/search/parameters/min_score.rb +16 -0
  86. data/lib/chewy/search/parameters/none.rb +25 -0
  87. data/lib/chewy/search/parameters/offset.rb +17 -0
  88. data/lib/chewy/search/parameters/order.rb +51 -0
  89. data/lib/chewy/search/parameters/post_filter.rb +19 -0
  90. data/lib/chewy/search/parameters/preference.rb +16 -0
  91. data/lib/chewy/search/parameters/profile.rb +16 -0
  92. data/lib/chewy/search/parameters/query.rb +19 -0
  93. data/lib/chewy/search/parameters/request_cache.rb +27 -0
  94. data/lib/chewy/search/parameters/rescore.rb +29 -0
  95. data/lib/chewy/search/parameters/script_fields.rb +16 -0
  96. data/lib/chewy/search/parameters/search_after.rb +20 -0
  97. data/lib/chewy/search/parameters/search_type.rb +16 -0
  98. data/lib/chewy/search/parameters/source.rb +77 -0
  99. data/lib/chewy/search/parameters/storage.rb +95 -0
  100. data/lib/chewy/search/parameters/stored_fields.rb +63 -0
  101. data/lib/chewy/search/parameters/suggest.rb +16 -0
  102. data/lib/chewy/search/parameters/terminate_after.rb +16 -0
  103. data/lib/chewy/search/parameters/timeout.rb +16 -0
  104. data/lib/chewy/search/parameters/track_scores.rb +16 -0
  105. data/lib/chewy/search/parameters/track_total_hits.rb +16 -0
  106. data/lib/chewy/search/parameters/version.rb +16 -0
  107. data/lib/chewy/search/parameters.rb +170 -0
  108. data/lib/chewy/search/query_proxy.rb +264 -0
  109. data/lib/chewy/search/request.rb +1071 -0
  110. data/lib/chewy/search/response.rb +119 -0
  111. data/lib/chewy/search/scoping.rb +49 -0
  112. data/lib/chewy/search/scrolling.rb +137 -0
  113. data/lib/chewy/search.rb +68 -28
  114. data/lib/chewy/stash.rb +68 -0
  115. data/lib/chewy/strategy/active_job.rb +3 -2
  116. data/lib/chewy/strategy/atomic.rb +2 -4
  117. data/lib/chewy/strategy/atomic_no_refresh.rb +18 -0
  118. data/lib/chewy/strategy/base.rb +13 -3
  119. data/lib/chewy/strategy/bypass.rb +1 -2
  120. data/lib/chewy/strategy/delayed_sidekiq/scheduler.rb +148 -0
  121. data/lib/chewy/strategy/delayed_sidekiq/worker.rb +52 -0
  122. data/lib/chewy/strategy/delayed_sidekiq.rb +17 -0
  123. data/lib/chewy/strategy/lazy_sidekiq.rb +64 -0
  124. data/lib/chewy/strategy/sidekiq.rb +15 -2
  125. data/lib/chewy/strategy/urgent.rb +1 -1
  126. data/lib/chewy/strategy.rb +16 -20
  127. data/lib/chewy/version.rb +1 -1
  128. data/lib/chewy.rb +81 -82
  129. data/lib/generators/chewy/install_generator.rb +3 -3
  130. data/lib/tasks/chewy.rake +99 -32
  131. data/migration_guide.md +56 -0
  132. data/spec/chewy/config_spec.rb +87 -15
  133. data/spec/chewy/fields/base_spec.rb +542 -233
  134. data/spec/chewy/fields/root_spec.rb +115 -17
  135. data/spec/chewy/fields/time_fields_spec.rb +13 -12
  136. data/spec/chewy/index/actions_spec.rb +595 -77
  137. data/spec/chewy/index/adapter/active_record_spec.rb +601 -0
  138. data/spec/chewy/index/adapter/object_spec.rb +243 -0
  139. data/spec/chewy/index/aliases_spec.rb +5 -5
  140. data/spec/chewy/index/import/bulk_builder_spec.rb +494 -0
  141. data/spec/chewy/index/import/bulk_request_spec.rb +95 -0
  142. data/spec/chewy/index/import/journal_builder_spec.rb +87 -0
  143. data/spec/chewy/index/import/routine_spec.rb +110 -0
  144. data/spec/chewy/index/import_spec.rb +615 -0
  145. data/spec/chewy/index/mapping_spec.rb +135 -0
  146. data/spec/chewy/index/observe/active_record_methods_spec.rb +68 -0
  147. data/spec/chewy/index/observe/callback_spec.rb +139 -0
  148. data/spec/chewy/index/observe_spec.rb +143 -0
  149. data/spec/chewy/index/settings_spec.rb +103 -50
  150. data/spec/chewy/index/specification_spec.rb +159 -0
  151. data/spec/chewy/index/syncer_spec.rb +118 -0
  152. data/spec/chewy/index/witchcraft_spec.rb +245 -0
  153. data/spec/chewy/index/wrapper_spec.rb +100 -0
  154. data/spec/chewy/index_spec.rb +149 -121
  155. data/spec/chewy/journal_spec.rb +223 -0
  156. data/spec/chewy/minitest/helpers_spec.rb +198 -0
  157. data/spec/chewy/minitest/search_index_receiver_spec.rb +118 -0
  158. data/spec/chewy/multi_search_spec.rb +84 -0
  159. data/spec/chewy/rake_helper_spec.rb +656 -0
  160. data/spec/chewy/repository_spec.rb +8 -8
  161. data/spec/chewy/rspec/build_query_spec.rb +34 -0
  162. data/spec/chewy/rspec/helpers_spec.rb +61 -0
  163. data/spec/chewy/rspec/update_index_spec.rb +220 -114
  164. data/spec/chewy/runtime_spec.rb +2 -2
  165. data/spec/chewy/search/loader_spec.rb +83 -0
  166. data/spec/chewy/search/pagination/kaminari_examples.rb +69 -0
  167. data/spec/chewy/search/pagination/kaminari_spec.rb +21 -0
  168. data/spec/chewy/search/parameters/aggs_spec.rb +5 -0
  169. data/spec/chewy/search/parameters/bool_storage_examples.rb +53 -0
  170. data/spec/chewy/search/parameters/collapse_spec.rb +5 -0
  171. data/spec/chewy/search/parameters/docvalue_fields_spec.rb +5 -0
  172. data/spec/chewy/search/parameters/explain_spec.rb +5 -0
  173. data/spec/chewy/search/parameters/filter_spec.rb +5 -0
  174. data/spec/chewy/search/parameters/hash_storage_examples.rb +59 -0
  175. data/spec/chewy/search/parameters/highlight_spec.rb +5 -0
  176. data/spec/chewy/search/parameters/ignore_unavailable_spec.rb +67 -0
  177. data/spec/chewy/search/parameters/indices_spec.rb +99 -0
  178. data/spec/chewy/search/parameters/integer_storage_examples.rb +32 -0
  179. data/spec/chewy/search/parameters/limit_spec.rb +5 -0
  180. data/spec/chewy/search/parameters/load_spec.rb +60 -0
  181. data/spec/chewy/search/parameters/min_score_spec.rb +32 -0
  182. data/spec/chewy/search/parameters/none_spec.rb +5 -0
  183. data/spec/chewy/search/parameters/offset_spec.rb +5 -0
  184. data/spec/chewy/search/parameters/order_spec.rb +72 -0
  185. data/spec/chewy/search/parameters/post_filter_spec.rb +5 -0
  186. data/spec/chewy/search/parameters/preference_spec.rb +5 -0
  187. data/spec/chewy/search/parameters/profile_spec.rb +5 -0
  188. data/spec/chewy/search/parameters/query_spec.rb +5 -0
  189. data/spec/chewy/search/parameters/query_storage_examples.rb +434 -0
  190. data/spec/chewy/search/parameters/request_cache_spec.rb +67 -0
  191. data/spec/chewy/search/parameters/rescore_spec.rb +62 -0
  192. data/spec/chewy/search/parameters/script_fields_spec.rb +5 -0
  193. data/spec/chewy/search/parameters/search_after_spec.rb +35 -0
  194. data/spec/chewy/search/parameters/search_type_spec.rb +5 -0
  195. data/spec/chewy/search/parameters/source_spec.rb +162 -0
  196. data/spec/chewy/search/parameters/storage_spec.rb +60 -0
  197. data/spec/chewy/search/parameters/stored_fields_spec.rb +126 -0
  198. data/spec/chewy/search/parameters/string_array_storage_examples.rb +63 -0
  199. data/spec/chewy/search/parameters/string_storage_examples.rb +32 -0
  200. data/spec/chewy/search/parameters/suggest_spec.rb +5 -0
  201. data/spec/chewy/search/parameters/terminate_after_spec.rb +5 -0
  202. data/spec/chewy/search/parameters/timeout_spec.rb +5 -0
  203. data/spec/chewy/search/parameters/track_scores_spec.rb +5 -0
  204. data/spec/chewy/search/parameters/track_total_hits_spec.rb +5 -0
  205. data/spec/chewy/search/parameters/version_spec.rb +5 -0
  206. data/spec/chewy/search/parameters_spec.rb +161 -0
  207. data/spec/chewy/search/query_proxy_spec.rb +119 -0
  208. data/spec/chewy/search/request_spec.rb +880 -0
  209. data/spec/chewy/search/response_spec.rb +202 -0
  210. data/spec/chewy/search/scrolling_spec.rb +171 -0
  211. data/spec/chewy/search_spec.rb +82 -55
  212. data/spec/chewy/stash_spec.rb +85 -0
  213. data/spec/chewy/strategy/active_job_spec.rb +27 -8
  214. data/spec/chewy/strategy/atomic_no_refresh_spec.rb +60 -0
  215. data/spec/chewy/strategy/atomic_spec.rb +13 -11
  216. data/spec/chewy/strategy/delayed_sidekiq_spec.rb +190 -0
  217. data/spec/chewy/strategy/lazy_sidekiq_spec.rb +214 -0
  218. data/spec/chewy/strategy/sidekiq_spec.rb +19 -7
  219. data/spec/chewy/strategy_spec.rb +19 -15
  220. data/spec/chewy_spec.rb +65 -88
  221. data/spec/spec_helper.rb +11 -20
  222. data/spec/support/active_record.rb +48 -6
  223. data/spec/support/class_helpers.rb +4 -19
  224. metadata +299 -183
  225. data/.travis.yml +0 -76
  226. data/Appraisals +0 -76
  227. data/gemfiles/rails.3.2.activerecord.gemfile +0 -15
  228. data/gemfiles/rails.3.2.activerecord.kaminari.gemfile +0 -14
  229. data/gemfiles/rails.3.2.activerecord.will_paginate.gemfile +0 -14
  230. data/gemfiles/rails.4.0.activerecord.gemfile +0 -15
  231. data/gemfiles/rails.4.0.activerecord.kaminari.gemfile +0 -14
  232. data/gemfiles/rails.4.0.activerecord.will_paginate.gemfile +0 -14
  233. data/gemfiles/rails.4.0.mongoid.4.0.0.gemfile +0 -15
  234. data/gemfiles/rails.4.0.mongoid.4.0.0.kaminari.gemfile +0 -14
  235. data/gemfiles/rails.4.0.mongoid.4.0.0.will_paginate.gemfile +0 -14
  236. data/gemfiles/rails.4.0.mongoid.5.1.0.gemfile +0 -15
  237. data/gemfiles/rails.4.0.mongoid.5.1.0.kaminari.gemfile +0 -14
  238. data/gemfiles/rails.4.0.mongoid.5.1.0.will_paginate.gemfile +0 -14
  239. data/gemfiles/rails.4.1.activerecord.gemfile +0 -15
  240. data/gemfiles/rails.4.1.activerecord.kaminari.gemfile +0 -14
  241. data/gemfiles/rails.4.1.activerecord.will_paginate.gemfile +0 -14
  242. data/gemfiles/rails.4.1.mongoid.4.0.0.gemfile +0 -15
  243. data/gemfiles/rails.4.1.mongoid.4.0.0.kaminari.gemfile +0 -14
  244. data/gemfiles/rails.4.1.mongoid.4.0.0.will_paginate.gemfile +0 -14
  245. data/gemfiles/rails.4.1.mongoid.5.1.0.gemfile +0 -15
  246. data/gemfiles/rails.4.1.mongoid.5.1.0.kaminari.gemfile +0 -14
  247. data/gemfiles/rails.4.1.mongoid.5.1.0.will_paginate.gemfile +0 -14
  248. data/gemfiles/rails.4.2.activerecord.gemfile +0 -16
  249. data/gemfiles/rails.4.2.activerecord.kaminari.gemfile +0 -15
  250. data/gemfiles/rails.4.2.activerecord.will_paginate.gemfile +0 -15
  251. data/gemfiles/rails.4.2.mongoid.4.0.0.gemfile +0 -15
  252. data/gemfiles/rails.4.2.mongoid.4.0.0.kaminari.gemfile +0 -14
  253. data/gemfiles/rails.4.2.mongoid.4.0.0.will_paginate.gemfile +0 -14
  254. data/gemfiles/rails.4.2.mongoid.5.1.0.gemfile +0 -15
  255. data/gemfiles/rails.4.2.mongoid.5.1.0.kaminari.gemfile +0 -14
  256. data/gemfiles/rails.4.2.mongoid.5.1.0.will_paginate.gemfile +0 -14
  257. data/gemfiles/rails.5.0.0.beta3.activerecord.gemfile +0 -16
  258. data/gemfiles/rails.5.0.0.beta3.activerecord.kaminari.gemfile +0 -16
  259. data/gemfiles/rails.5.0.0.beta3.activerecord.will_paginate.gemfile +0 -15
  260. data/gemfiles/sequel.4.31.gemfile +0 -13
  261. data/lib/chewy/backports/deep_dup.rb +0 -46
  262. data/lib/chewy/backports/duplicable.rb +0 -90
  263. data/lib/chewy/query/compose.rb +0 -69
  264. data/lib/chewy/query/criteria.rb +0 -181
  265. data/lib/chewy/query/filters.rb +0 -227
  266. data/lib/chewy/query/loading.rb +0 -111
  267. data/lib/chewy/query/nodes/and.rb +0 -25
  268. data/lib/chewy/query/nodes/base.rb +0 -17
  269. data/lib/chewy/query/nodes/bool.rb +0 -32
  270. data/lib/chewy/query/nodes/equal.rb +0 -34
  271. data/lib/chewy/query/nodes/exists.rb +0 -20
  272. data/lib/chewy/query/nodes/expr.rb +0 -28
  273. data/lib/chewy/query/nodes/field.rb +0 -106
  274. data/lib/chewy/query/nodes/has_child.rb +0 -14
  275. data/lib/chewy/query/nodes/has_parent.rb +0 -14
  276. data/lib/chewy/query/nodes/has_relation.rb +0 -61
  277. data/lib/chewy/query/nodes/match_all.rb +0 -11
  278. data/lib/chewy/query/nodes/missing.rb +0 -20
  279. data/lib/chewy/query/nodes/not.rb +0 -25
  280. data/lib/chewy/query/nodes/or.rb +0 -25
  281. data/lib/chewy/query/nodes/prefix.rb +0 -18
  282. data/lib/chewy/query/nodes/query.rb +0 -20
  283. data/lib/chewy/query/nodes/range.rb +0 -63
  284. data/lib/chewy/query/nodes/raw.rb +0 -15
  285. data/lib/chewy/query/nodes/regexp.rb +0 -31
  286. data/lib/chewy/query/nodes/script.rb +0 -20
  287. data/lib/chewy/query/pagination/will_paginate.rb +0 -27
  288. data/lib/chewy/query/pagination.rb +0 -16
  289. data/lib/chewy/query/scoping.rb +0 -20
  290. data/lib/chewy/query.rb +0 -1026
  291. data/lib/chewy/strategy/resque.rb +0 -26
  292. data/lib/chewy/type/actions.rb +0 -19
  293. data/lib/chewy/type/adapter/active_record.rb +0 -72
  294. data/lib/chewy/type/adapter/mongoid.rb +0 -58
  295. data/lib/chewy/type/adapter/object.rb +0 -89
  296. data/lib/chewy/type/adapter/orm.rb +0 -156
  297. data/lib/chewy/type/adapter/sequel.rb +0 -75
  298. data/lib/chewy/type/crutch.rb +0 -31
  299. data/lib/chewy/type/import.rb +0 -224
  300. data/lib/chewy/type/observe.rb +0 -76
  301. data/lib/chewy/type/wrapper.rb +0 -53
  302. data/lib/chewy/type.rb +0 -89
  303. data/lib/sequel/plugins/chewy_observe.rb +0 -78
  304. data/spec/chewy/query/criteria_spec.rb +0 -433
  305. data/spec/chewy/query/filters_spec.rb +0 -173
  306. data/spec/chewy/query/loading_spec.rb +0 -86
  307. data/spec/chewy/query/nodes/and_spec.rb +0 -16
  308. data/spec/chewy/query/nodes/bool_spec.rb +0 -22
  309. data/spec/chewy/query/nodes/equal_spec.rb +0 -32
  310. data/spec/chewy/query/nodes/exists_spec.rb +0 -18
  311. data/spec/chewy/query/nodes/has_child_spec.rb +0 -40
  312. data/spec/chewy/query/nodes/has_parent_spec.rb +0 -40
  313. data/spec/chewy/query/nodes/match_all_spec.rb +0 -11
  314. data/spec/chewy/query/nodes/missing_spec.rb +0 -15
  315. data/spec/chewy/query/nodes/not_spec.rb +0 -16
  316. data/spec/chewy/query/nodes/or_spec.rb +0 -16
  317. data/spec/chewy/query/nodes/prefix_spec.rb +0 -16
  318. data/spec/chewy/query/nodes/query_spec.rb +0 -12
  319. data/spec/chewy/query/nodes/range_spec.rb +0 -32
  320. data/spec/chewy/query/nodes/raw_spec.rb +0 -11
  321. data/spec/chewy/query/nodes/regexp_spec.rb +0 -31
  322. data/spec/chewy/query/nodes/script_spec.rb +0 -15
  323. data/spec/chewy/query/pagination/kaminari_spec.rb +0 -57
  324. data/spec/chewy/query/pagination/will_paginage_spec.rb +0 -60
  325. data/spec/chewy/query/pagination_spec.rb +0 -36
  326. data/spec/chewy/query_spec.rb +0 -632
  327. data/spec/chewy/strategy/resque_spec.rb +0 -40
  328. data/spec/chewy/type/actions_spec.rb +0 -31
  329. data/spec/chewy/type/adapter/active_record_spec.rb +0 -317
  330. data/spec/chewy/type/adapter/mongoid_spec.rb +0 -253
  331. data/spec/chewy/type/adapter/object_spec.rb +0 -139
  332. data/spec/chewy/type/adapter/sequel_spec.rb +0 -320
  333. data/spec/chewy/type/import_spec.rb +0 -433
  334. data/spec/chewy/type/mapping_spec.rb +0 -106
  335. data/spec/chewy/type/observe_spec.rb +0 -127
  336. data/spec/chewy/type/witchcraft_spec.rb +0 -154
  337. data/spec/chewy/type/wrapper_spec.rb +0 -58
  338. data/spec/chewy/type_spec.rb +0 -33
  339. data/spec/support/mongoid.rb +0 -81
  340. data/spec/support/sequel.rb +0 -75
data/CHANGELOG.md CHANGED
@@ -1,169 +1,482 @@
1
- # master
1
+ # Changelog
2
2
 
3
- ## Changes
3
+ ## master (unreleased)
4
4
 
5
- * Brand new import `:bulk_size` option, set desired ElasticSearch bulk size in bytes
5
+ ### New Features
6
6
 
7
- * Witchcraft™ technology
7
+ ### Changes
8
8
 
9
- * Configurable per-type default import options (@barthez, #341)
9
+ ### Bugs Fixed
10
10
 
11
- * Various codebase optimizations (@DNNX, @pyromaniac)
11
+ ## 7.3.4 (2023-08-29)
12
12
 
13
- * `update_index` Rspec matcher messages improvements
13
+ ### New Features
14
14
 
15
- * `:all` rake tasks deprecation
15
+ * [#888](https://github.com/toptal/chewy/pull/892): Rake task to create missing indexes ([@konalegi](https://github.com/konalegi))
16
16
 
17
- * Scoped notification subscriptions in rake tasks (@0x0badc0de, #335)
17
+ ### Changes
18
18
 
19
- * Async strategies workers accept options (@dnd, #321)
19
+ ### Bugs Fixed
20
20
 
21
- * Prefix is configurable per-index (@mikeyhogarth, #314)
21
+ ## 7.3.3 (2023-07-07)
22
22
 
23
- * Ability to pass proc for transport configuration (@feymartynov, @reidab, #302, #339)
23
+ ### New Features
24
24
 
25
- * ElasticSearch 2 support (@sergeygaychuk, #297)
25
+ * [#888](https://github.com/toptal/chewy/pull/888/files): Skip journal creation on import ([@konalegi](https://github.com/konalegi))
26
26
 
27
- * Accessing types with methods is deprecated. Use `MyIndex::MyType` constant reference instead of `MyIndex.my_type` method.
27
+ ### Changes
28
28
 
29
- * Sequel adapter improvements (@mrbrdo, #294)
29
+ ### Bugs Fixed
30
30
 
31
- ## Bugfixes
31
+ ## 7.3.2 (2023-04-20)
32
32
 
33
- * Mongoid atomic strategy fix (#325)
33
+ ### New Features
34
34
 
35
- * Method missing fix (@jesjos, #324)
35
+ ### Changes
36
36
 
37
- * Hash fields composition fix (@eproulx-petalmd, #319)
37
+ ### Bugs Fixed
38
38
 
39
- * Better errors handling in strategies (@barthez, #306)
39
+ * [#861](https://github.com/toptal/chewy/pull/861): Fix bug in mock_elasticsearch_response_sources ([@lafeber](https://github.com/lafeber))
40
40
 
41
- * Assets strategies silencer fix for Rails 5 API mode (@clupprich, #303)
41
+ ## 7.3.1 (2023-04-20)
42
42
 
43
- # Version 0.8.3
43
+ ### Bugs Fixed
44
44
 
45
- ## Changes
45
+ * [#874](https://github.com/toptal/chewy/pull/874): Fix `chewy:journal:clean` task for ruby 3.x. ([@muk-ai](https://github.com/muk-ai))
46
+ * [#882](https://github.com/toptal/chewy/pull/882): Fix memory leak during `chewy:reset` for ruby 3.2 ([@konalegi](https://github.com/konalegi))
46
47
 
47
- * Sequel support completely reworked to use common ORM implementations + better sequel specs covarage.
48
+ ## 7.3.0 (2023-04-03)
48
49
 
49
- ## Bugfixes
50
+ ### New Features
50
51
 
51
- * Sequel objects transactional destruction fix
52
+ * [#869](https://github.com/toptal/chewy/pull/869): New strategy - `delayed_sidekiq`. Allow passing `strategy: :delayed_sidekiq` option to `SomeIndex.import([1, ...], strategy: :delayed_sidekiq)`. The strategy is compatible with `update_fields` option as well. ([@skcc321][])
53
+ * [#879](https://github.com/toptal/chewy/pull/879): Configure CI to check for ruby 3.2 compatibility. ([@konalegi][])
52
54
 
53
- * Correct Rspec mocking framework checking (@mainameiz)
55
+ ### Changes
54
56
 
55
- * Atomic strategy is now compatible with custom ids proc.
57
+ ### Bugs Fixed
56
58
 
57
- * Safe unsubscribe on import (@marshall-lee)
59
+ * [#856](https://github.com/toptal/chewy/pull/856): Fix return value of subscribed_task_stats used in rake tasks. ([@fabiormoura][])
58
60
 
59
- * Correct custom assets path silencer (@davekaro)
61
+ ## 7.2.7 (2022-11-15)
60
62
 
61
- ## Incompatible changes:
63
+ ### New Features
62
64
 
63
- * `Chewy.atomic` and `Chewy.urgent_update=` methods was removed from the codebase, use `Chewy.strategy` block instead.
65
+ * [#857](https://github.com/toptal/chewy/pull/857): Allow passing `wait_for_completion`, `request_per_second` and `scroll_size` options to `chewy:journal:clean` rake task and `delete_all` query builder method. ([@konalegi][])([@barthez][])
64
66
 
65
- * `delete_from_index?` hook is removed from the codebase.
67
+ ### Changes
66
68
 
67
- # Version 0.8.2
69
+ ### Bugs Fixed
68
70
 
69
- ## Changes
71
+ * [#863](https://github.com/toptal/chewy/pull/863): Fix `crutches` call doesn't respect `update_fields` option. ([@skcc321][])
70
72
 
71
- * ActiveJob strategy by @mkcode
73
+ ## 7.2.6 (2022-06-13)
72
74
 
73
- * Async strategies tweak (@AndreySavelyev)
75
+ ### New Features
74
76
 
75
- * GeoPoint readme (@joonty)
77
+ * [#841](https://github.com/toptal/chewy/pull/841): Add the [`collapse`](https://www.elastic.co/guide/en/elasticsearch/reference/current/collapse-search-results.html) option to the request. ([@jkostolansky][])
76
78
 
77
- * Multiple grammar fixes and code improvements (@biow0lf)
79
+ ### Bugs Fixed
78
80
 
79
- * Named aggregations by @caldwecr
81
+ * [#842](https://github.com/toptal/chewy/issues/842): Fix `ignore_blank` handling. ([@rabotyaga][])
82
+ * [#848](https://github.com/toptal/chewy/issues/848): Fix invalid journal pagination. ([@konalegi][])
80
83
 
81
- * Sequel adapter by @jirutka
84
+ ## 7.2.5 (2022-03-04)
82
85
 
83
- * Rake helper methods extracted (@caldwecr, @jirutka)
86
+ ### New Features
84
87
 
85
- * Multiple grammar fixes (@henrebotha)
88
+ * [#827](https://github.com/toptal/chewy/pull/827): Add `:lazy_sidekiq` strategy, that defers not only importing but also `update_index` callback evaluation for created and updated objects. ([@sl4vr][])
89
+ * [#827](https://github.com/toptal/chewy/pull/827): Add `:atomic_no_refresh` strategy. Like `:atomic`, but `refresh=false` parameter is set. ([@barthez][])
90
+ * [#827](https://github.com/toptal/chewy/pull/827): Add `:no_refresh` chain call to `update_index` matcher to ensure import was called with `refresh=false`. ([@barthez][])
86
91
 
87
- * Ability to pass a proc to `update_index` to define updating index dynamically (@SeTeM)
92
+ ### Bugs Fixed
88
93
 
94
+ * [#835](https://github.com/toptal/chewy/pull/835): Support keyword arguments in named scopes. ([@milk1000cc][])
89
95
 
90
- ## Bugfixes
96
+ ## 7.2.4 (2022-02-03)
91
97
 
92
- * Fixed transport logger and tracer configuration
98
+ ### New Features
93
99
 
94
- # Version 0.8.1
100
+ * [#760](https://github.com/toptal/chewy/pull/760): Replace parent-child mapping with a [join field](https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html#parent-child-mapping-types) ([@mrzasa][])
95
101
 
96
- ## Bugfixes
102
+ ### Bugs Fixed
97
103
 
98
- * Added support of elasticsearch-ruby 1.0.10
104
+ * [#825](https://github.com/toptal/chewy/issues/825): Fix mismatch argument names at update_mapping rake task ([@AgeevAndrew][])
105
+ * [#832](https://github.com/toptal/chewy/issues/832): Fix "cannot load such file -- `i18n/core_ext/hash`" ([@chrisandreae][])
99
106
 
100
- # Version 0.8.0
107
+ ## 7.2.3 (2021-10-29)
101
108
 
102
- ## Incompatible changes:
109
+ ### New Features
103
110
 
104
- * `:atomic` and `:urgent` strategies are using `import!` method raising exceptions
111
+ * [#801](https://github.com/toptal/chewy/pull/801): Add the [`track_total_hits`](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-your-data.html#track-total-hits) option to the query. ([@milk1000cc][])
112
+ * [#810](https://github.com/toptal/chewy/pull/810): Use `unsafe_load` when loading config to support Psych 4.
113
+ * [#819](https://github.com/toptal/chewy/pull/819): Add the [`ignore_unavailable`](https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-index.html#multi-index) option to the request. ([@kolauren][])
105
114
 
106
- ## Changes
115
+ ### Changes
107
116
 
108
- * Crutches™ technology
117
+ * [#817](https://github.com/toptal/chewy/pull/817): Show warning message during rake chewy:reset or chewy:upgrade if journaling is disabled. ([@konalegi][])
109
118
 
110
- * Added `.script_fields` chainable method to query (@ka8725)
119
+ ### Bugs Fixed
111
120
 
112
- * `update_index` matcher mocha support (@lardawge)
121
+ * [#816](https://github.com/toptal/chewy/pull/816): Move query [`preference`](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-search.html#search-preference) from body to query parameters. ([@afg419][])
113
122
 
114
- * `:resque` async strategy
123
+ ## 7.2.2 (2021-05-24)
115
124
 
116
- * `:sidekiq` async strategy (inspired by @sharkzp)
125
+ ### Changes
117
126
 
118
- * Added `Query#search_type` for `search_type` request option setup (@marshall-lee)
127
+ * [#800](https://github.com/toptal/chewy/pull/800): Revert [#787](https://github.com/toptal/chewy/pull/787) progressbar feature to avoid performance degradation in parallel import ([@rabotyaga][])
119
128
 
120
- ## Bugfixes
129
+ * [#795](https://github.com/toptal/chewy/issues/795): **(Breaking)** Change the Chewy::Search::Parameters::Order implementation to use Array ([@jiajiawang][]):
130
+ * To allow multiple sorting options that may have the same key name. For example script based sorting whose key will always be `_script`.
131
+ * Behaviour change of chained `order` calls.
132
+ * e.g. `.order(_script: {a: 1}).order(_script: {b: 2})`
133
+ * Before `{:sort=>[{"_script"=>{:b=>2}}]}`
134
+ * After `{:sort=>[{"_script"=>{:a=>1}},{"_script"=>{:b=>2}}]}`
121
135
 
122
- * Rails 4.2 migrations are not raising UndefinedUpdateStrategy anymore on data updates
136
+ * [#654](https://github.com/toptal/chewy/issues/654): Add helpers and matchers for testing ([@Vitalina-Vakulchyk][]):
137
+ * `mock_elasticsearch_response` helpers both Rspec and Minitest - to mock elasticsearch response
138
+ * `mock_elasticsearch_response_sources` helpers both Rspec and Minitest - to mock elasticsearch response sources
139
+ * `assert_elasticsearch_query` helper for Minitest - to compare request and expected query (returns `true`/`false`)
140
+ * `build_query` matcher for Rspec - to compare request and expected query (returns `true`/`false`)
123
141
 
124
- * Mongoid random failing specs fixes (@marshall-lee)
142
+ ## 7.2.1 (2021-05-11)
125
143
 
126
- # Version 0.7.0
144
+ ### New Features
127
145
 
128
- ## Incompatible changes:
146
+ * [#469](https://github.com/toptal/chewy/issues/469): Add ability to output the progressbar with `ENV['PROGRESS']` during `reset` rake tasks ([@Vitalina-Vakulchyk][]):
147
+ * for `rake chewy:reset` and `rake chewy:parallel:reset`
148
+ * progressbar is hidden by default, set `ENV['PROGRESS']` to `true` to display it
129
149
 
130
- * `Chewy.use_after_commit_callbacks = false` returns previous RDBMS behavior
131
- in tests
150
+ ### Bugs Fixed
132
151
 
133
- * ActiveRecord import is now called after_commit instead of after_save and after_destroy
152
+ * [#796](https://github.com/toptal/chewy/pull/796): Fix clear scroll: pass `scroll_id` in body, as passing in path parameters is deprecated and can overflow `http.max_initial_line_length` ([@rabotyaga][])
134
153
 
135
- * Import now respects default scope and removes unmatched documents
154
+ ## 7.0.1 (2021-05-03)
136
155
 
137
- * `delete_from_index?` method is deprecated, use
156
+ ### Changes
157
+
158
+ * [#792](https://github.com/toptal/chewy/pull/792): Skip ES version memoization for search requests ([@rabotyaga][])
159
+ * See the Migration Guide for details
160
+
161
+ ## 7.2.0 (2021-04-19)
162
+
163
+ ### New Features
164
+
165
+ * [#778](https://github.com/toptal/chewy/pull/778): Add `ignore_blank` option to `field` method ([@Vitalina-Vakulchyk][]):
166
+ * `true` by default for the `geo_point` type
167
+ * `false` by default for other types
168
+
169
+ ### Changes
170
+
171
+ * [#783](https://github.com/toptal/chewy/pull/783): **(Breaking)** Remove `Chewy::Type`, simplify DSL ([@rabotyaga][])
172
+ * Remove the `Chewy::Type` class
173
+ * e.g. remove `CitiesIndex::City` / `CitiesIndex.city`
174
+ * `CitiesIndex::City.import! ...` becomes `CitiesIndex.import! ...`
175
+ * Simplify index DSL:
176
+ * `define_type` block -> `index_scope` clause
177
+ * it can be omitted completely, if you don't need to specify the scope or options, e.g. `name`
178
+ * Remove type names from string representations:
179
+ * in `update_index` ActiveRecord helper and RSpec matcher, e.g.
180
+ * `update_index('cities#city')` -> `update_index('cities')`
181
+ * `update_index(UsersIndex::User)` -> `update_index(UsersIndex)`
182
+ * in rake tasks (e.g. `rake chewy:update[cities#city]` -> `rake chewy:update[cities]`)
183
+ * in rake tasks output (e.g. `Imported CitiesIndex::City in 1s, stats: index 3` -> `Imported CitiesIndex in 1s, stats: index 3`)
184
+ * Use index name instead of type name in loader additional scope
185
+ * e.g. `CitiesIndex.filter(...).load(city: {scope: City.where(...)})` -> `CitiesIndex.filter(...).load(cities: {scope: City.where(...)})`
186
+ * [#692](https://github.com/toptal/chewy/issues/692): Add `.update_mapping` to Index class ([@Vitalina-Vakulchyk][]):
187
+ * Wrapped Elasticsearch gem `.put_mapping` with `.update_mapping` in Index class
188
+ * Add `rake chewy:update_mapping` task
189
+ * [#594](https://github.com/toptal/chewy/issues/594): Add `.reindex` to Index class ([@Vitalina-Vakulchyk][]):
190
+ * Wrapped Elasticsearch gem `.reindex` with `.reindex` in Index class
191
+ * Add `rake chewy:reindex` task
192
+ * [#679](https://github.com/toptal/chewy/issues/679): Wrapped `Elasticsearch::API::Indices::Actions#clear_cache` with `.clear_cache` in Index class ([@Vitalina-Vakulchyk][])
193
+ * [#495](https://github.com/toptal/chewy/issues/495): Ability to change Rails console strategy with `Chewy.console_strategy` ([@Vitalina-Vakulchyk][])
194
+ * [#778](https://github.com/toptal/chewy/pull/778): **(Breaking)** Drop support for Ruby 2.5 ([@Vitalina-Vakulchyk][])
195
+ * [#776](https://github.com/toptal/chewy/pull/776): **(Breaking)** Removal of unnecessary features and integrations ([@Vitalina-Vakulchyk][]):
196
+ * `aws-sdk-sqs` / `shoryuken`
197
+ * `mongoid`
198
+ * `sequel`
199
+ * `will_paginate`
200
+ * `resque`
201
+ * [#769](https://github.com/toptal/chewy/pull/769): **(Breaking)** Removal of deprecated methods and rake tasks ([@Vitalina-Vakulchyk][]):
202
+ * `Chewy::Index.index_params` is removed, use `Chewy::Index.specification_hash` instead
203
+ * `Chewy::Index.derivable_index_name` is removed, use `Chewy::Index.derivable_name` instead
204
+ * `Chewy::Index.default_prefix` is removed, use `Chewy::Index.prefix` instead
205
+ * `Chewy::Index.build_index_name` is removed, use `Chewy::Index.index_name` instead
206
+ * `Chewy::RakeHelper.reset_index` is removed, use `Chewy::RakeHelper.reset` instead
207
+ * `Chewy::RakeHelper.reset_all` is removed, use `Chewy::RakeHelper.reset` instead
208
+ * `Chewy::RakeHelper.update_index` is removed, use `Chewy::RakeHelper.update` instead
209
+ * `Chewy::RakeHelper.update_all` is removed, use `Chewy::RakeHelper.update` instead
210
+ * `rake chewy:apply_changes_from` is removed, use `rake chewy:journal:apply` instead
211
+ * `rake chewy:clean_journal` is removed, use `rake chewy:journal:clean` instead
212
+
213
+ ## 7.1.0 (2021-03-03)
214
+
215
+ ### Changes
216
+
217
+ * [#766](https://github.com/toptal/chewy/pull/766): **(Breaking)** Drop support for Elasticsearch 6.x ([@rabotyaga][])
218
+ * [#765](https://github.com/toptal/chewy/pull/765): Fix ruby 2.7 warnings in rake tasks ([@aglushkov][])
219
+
220
+ ### Bugs Fixed
221
+
222
+ * [#722](https://github.com/toptal/chewy/issues/722): Remove alias_method_chain, use Module#prepend instead ([@dalthon][])
223
+
224
+ ## 7.0.0 (2021-02-22)
225
+
226
+ ### New Features
227
+
228
+ * [#763](https://github.com/toptal/chewy/pull/763): Added support for Elasticsearch 7 ([@rabotyaga][])
229
+
230
+ ### Changes
231
+
232
+ * [#757](https://github.com/toptal/chewy/pull/757): **(Breaking)** Fix `Chewy::Index.index` & `Chewy::Index.aliases` to correctly report indexes and aliases ([@mpeychich][], [@dalthon][])
233
+ * [#761](https://github.com/toptal/chewy/pull/761): Avoid fetching scope data to check if it is blank ([@dalthon][])
234
+
235
+ ## 6.0.0 (2021-02-11)
236
+
237
+ ### Changes
238
+
239
+ * [#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][])
240
+ * [#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][])
241
+ * [#755](https://github.com/toptal/chewy/pull/755): `attribute_highlights` returns an array of highlights. ([@musaffa][], [@dalthon][])
242
+ * [#753](https://github.com/toptal/chewy/pull/753): Add support for direct_import parameter to skip objects reloading. ([@TikiTDO][], [@dalthon][])
243
+ * [#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][])
244
+
245
+ ### Bugs Fixed
246
+
247
+ * [#695](https://github.com/toptal/chewy/pull/695): Clear the scroll by id after completing `scroll_batches`. ([@socialchorus][])
248
+ * [#749](https://github.com/toptal/chewy/pull/749): Avoid importing everything when given an empty relation. ([@JF-Lalonde][], [@dalthon][])
249
+ * [#736](https://github.com/toptal/chewy/pull/736): Fix nil children when using witchcraft. ([@taylor-au][])
250
+
251
+ ## 5.2.0 (2021-01-28)
252
+
253
+ ### Changes
254
+
255
+ * [#734](https://github.com/toptal/chewy/pull/734): Add support for Ruby 3. ([@lowang][])
256
+ * [#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][])
257
+ * [#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][])
258
+ * Tweak some wording and formatting; add a note about compatibility; update copyright; remove broken logo; update the CI badge. ([@bbatsov][])
259
+ * [#714](https://github.com/toptal/chewy/pull/714): Update instructions for AWS ElasticSearch. ([@olancheg][])
260
+ * [#728](https://github.com/toptal/chewy/pull/728): Fix more ruby 2.7 keyword params deprecation warnings. ([@aglushkov][])
261
+ * [#715](https://github.com/toptal/chewy/pull/715): Fixed all deprecation warnings in Ruby 2.7. ([@gseddon][])
262
+ * [#718](https://github.com/toptal/chewy/pull/718): Added Ruby 2.7 to CircleCI config. ([@mrzasa][])
263
+ * [#707](https://github.com/toptal/chewy/pull/707): Allow configuration of Active Job queue name. ([@mrzasa][])
264
+ * [#711](https://github.com/toptal/chewy/pull/711): Setup CI on CircleCI. ([@mrzasa][])
265
+ * [#710](https://github.com/toptal/chewy/pull/710): Fix deprecation warning for constructing new `BigDecimal`. ([@AlexVPopov][])
266
+
267
+ ## 5.1.0 (2019-09-24)
268
+
269
+ ### Changes
270
+
271
+ * [#657](https://github.com/toptal/chewy/pull/657): **(Breaking)** Add support for multiple indices in request. ([@pyromaniac][])
272
+ * [#647](https://github.com/toptal/chewy/pull/647): **(Breaking)** Support `search_type`, `request_cache`, and `allow_partial_search_results` as query string parameters. ([@mattzollinhofer][])
273
+ * [#606](https://github.com/toptal/chewy/pull/606): Speed up imports when `bulk_size` is specified. ([@yahooguntu][])
274
+ * [#682](https://github.com/toptal/chewy/pull/682): Insert `RequestStrategy` middleware before `ActionDispatch::ShowExceptions`. ([@dck][])
275
+
276
+ ## 5.0.0 (2018-02-13)
277
+
278
+ ### Changes
279
+
280
+ * **(Breaking)** Align the gem version with the most recent ElasticSearch version we support.
281
+ * **(Breaking)** `Chewy.default_field_type` is `text` now.
282
+ * **(Breaking)** `Chewy::Stash` was split onto two indexes - `Chewy::Stash::Specification` and `Chewy::Stash::Journal`.
283
+ * **(Breaking)** Data for journal and specification is stored in binary fields base64-encoded to bypass the limits of other fields.
284
+ * **(Breaking)** [#626](https://github.com/toptal/chewy/pull/626): Don't underscore suggested index name. ([@dm1try][])
285
+ * [#598](https://github.com/toptal/chewy/pull/598): `pipeline` import option support. ([@eManPrague][])
286
+ * [#625](https://github.com/toptal/chewy/pull/625): Proper Rails check. ([@nattfodd][])
287
+ * [#623](https://github.com/toptal/chewy/pull/623): Bypass strategy performance improvements. ([@DNNX][])
288
+ * [#620](https://github.com/toptal/chewy/pull/620): Avoid index update calls for empty data. ([@robertasg][])
289
+ * Do not underscore suggested index name on `Chewy::Index.index_name` call.
290
+ * 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.
291
+ * [#565](https://github.com/toptal/chewy/pull/565): Fixed some Sequel deprecation warnings. ([@arturtr][])
292
+ * [#577](https://github.com/toptal/chewy/pull/577): Fixed some Sequel deprecation warnings. ([@matchbookmac][])
293
+
294
+ ### Bugs Fixed
295
+
296
+ * [#593](https://github.com/toptal/chewy/pull/593): Fixed index settings logic error. ([@yahooguntu][])
297
+ * [#567](https://github.com/toptal/chewy/pull/567): Missed check in higlight method. ([@heartfulbird][])
298
+
299
+ -----------------------------------------------------------------------------------
300
+
301
+ ## 0.10.1
302
+
303
+ ### Changes
304
+
305
+ * [#558](https://github.com/toptal/chewy/pull/558): Improved parallel worker titles
306
+
307
+ ### Bugs Fixed
308
+
309
+ * [#557](https://github.com/toptal/chewy/pull/557): Fixed request strategy initial debug message
310
+ * [#556](https://github.com/toptal/chewy/pull/556): Fixed will objects paginated array initialization when pagination was not used
311
+ * [#555](https://github.com/toptal/chewy/pull/555): Fixed fields symbol/string value
312
+ * [#554](https://github.com/toptal/chewy/pull/554): Fixed root field value proc
313
+
314
+ ## 0.10.0
315
+
316
+ ### Breaking changes
317
+
318
+ * Changed behavior of `Chewy::Index.index_name`, it doesn't cache the values anymore.
319
+ * Journal interfaces, related code and rake tasks were completely refactored and are not compatible with the previous version.
320
+
321
+ ### Changes
138
322
 
323
+ * [#543](https://github.com/toptal/chewy/pull/543): Less noisy strategies logging ([@Borzik][])
324
+ * Parallel import and the corresponding rake tasks.
325
+ * [#532](https://github.com/toptal/chewy/pull/532): `:shoryuken` async strategy ([@josephchoe][])
326
+ * Deprecate `Chewy::Index.build_index_name`.
327
+ * Rename `Chewy::Index.default_prefix` to `Chewy::Index.prefix`. The old one is deprecated.
328
+ * Add `Chewy::Type.derivable_name` for consistency.
329
+ * Rename `Chewy::Index.derivable_index_name` to `Chewy::Index.derivable_name`.
330
+ `Chewy::Index.derivable_index_name` and `Chewy::Type.derivable_index_name` are deprecated.
331
+ * Use normal YAML loading, for the config, we don't need the safe one.
332
+ * [#526](https://github.com/toptal/chewy/pull/526): `default_root_options` option ([@barthez][])
333
+ * Partial indexing ability: it is possible to update only specified fields.
334
+ * New cool `rake chewy:deploy` task.
335
+ * Selective reset (resets only if necessary): `rake chewy:upgrade`.
336
+ * Consistency checks and synchronization: `rake chewy:sync`.
337
+ * Brand new request DSL. Supports ElasticSearch 2 and 5, better usability, architecture and docs.
338
+ * Add Kaminari 1.0 support.
339
+ * [#483](https://github.com/toptal/chewy/pull/483): `skip_index_creation_on_import` option ([@sergey-kintsel][])
340
+ * [#481](https://github.com/toptal/chewy/pull/481): Ability to use procs for settings ([@parallel588][])
341
+ * [#467](https://github.com/toptal/chewy/pull/467): Bulk indexing optimizations with new additional options ([@eproulx-petalmd][])
342
+ * [#438](https://github.com/toptal/chewy/pull/438): Configurable sidekiq options ([@averell23][])
343
+
344
+ ## 0.9.0
345
+
346
+ ### Changes
347
+
348
+ * [#443](https://github.com/toptal/chewy/pull/443): Add `preference` param to Query ([@menglewis][])
349
+ * [#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][])
350
+ * [#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][])
351
+ * [#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][])
352
+ * [#396](https://github.com/toptal/chewy/pull/396): Minitest helpers ([@robacarp][])
353
+ * [#393](https://github.com/toptal/chewy/pull/393): `Chewy::Query#unlimited` to fetch all the documents ([@sergey-kintsel][])
354
+ * [#386](https://github.com/toptal/chewy/pull/386): `Chewy::Query#exists?` ([@sergey-kintsel][])
355
+ * [#381](https://github.com/toptal/chewy/pull/381), [#376](https://github.com/toptal/chewy/pull/376): Import otimizations
356
+ * [#375](https://github.com/toptal/chewy/pull/375): Additional import optimization technique - [raw import](https://github.com/toptal/chewy/#raw-import) ([@DNNX][])
357
+ * [#380](https://github.com/toptal/chewy/pull/380): `weight` scoring dunction was added to the search DSL ([@sevab][])
358
+ * Rake tasks support multiple indexes and exceptions: `rake chewy:reset[users,projects]`, `rake chewy:update[-projects]`
359
+ * Witchcraft™ supports dynamically generated procs with variables from closure.
360
+ * Added `Query#preference` for specifying shard replicas to query against. ([@menglewis][])
361
+
362
+ ### Bugs Fixed
363
+
364
+ * [#415](https://github.com/toptal/chewy/pull/415): `.script_fields` method in the Index class ([@dmitry][])
365
+ * [#398](https://github.com/toptal/chewy/pull/398): Fix routing_missing_exception on delete with parent missing ([@guigs][])
366
+ * [#385](https://github.com/toptal/chewy/pull/385): Sequel custom primary keys handling fix ([@okliv][])
367
+ * [#374](https://github.com/toptal/chewy/pull/374): Bulk import fixes ([@0x0badc0de][])
368
+
369
+ ## 0.8.4
370
+
371
+ ### Changes
372
+
373
+ * Brand new import `:bulk_size` option, set desired ElasticSearch bulk size in bytes
374
+ * Witchcraft™ technology
375
+ * [#341](https://github.com/toptal/chewy/pull/341): Configurable per-type default import options ([@barthez][])
376
+ * Various codebase optimizations ([@DNNX][], [@pyromaniac][])
377
+ * `update_index` Rspec matcher messages improvements
378
+ * `:all` rake tasks deprecation
379
+ * [#335](https://github.com/toptal/chewy/pull/335): Scoped notification subscriptions in rake tasks ([@0x0badc0de][])
380
+ * [#321](https://github.com/toptal/chewy/pull/321): Async strategies workers accept options ([@dnd][])
381
+ * [#314](https://github.com/toptal/chewy/pull/314): Prefix is configurable per-index ([@mikeyhogarth][])
382
+ * [#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][])
383
+ * [#297](https://github.com/toptal/chewy/pull/297): ElasticSearch 2 support ([@sergeygaychuk][])
384
+ * Accessing types with methods is deprecated. Use `MyIndex::MyType` constant reference instead of `MyIndex.my_type` method.
385
+ * [#294](https://github.com/toptal/chewy/pull/294): Sequel adapter improvements ([@mrbrdo][])
386
+
387
+ ### Bugs Fixed
388
+
389
+ * [#325](https://github.com/toptal/chewy/pull/325): Mongoid atomic strategy fix
390
+ * [#324](https://github.com/toptal/chewy/pull/324): Method missing fix ([@jesjos][])
391
+ * [#319](https://github.com/toptal/chewy/pull/319): Hash fields composition fix ([@eproulx-petalmd][])
392
+ * [#306](https://github.com/toptal/chewy/pull/306): Better errors handling in strategies ([@barthez][])
393
+ * [#303](https://github.com/toptal/chewy/pull/303): Assets strategies silencer fix for Rails 5 API mode ([@clupprich][])
394
+
395
+ ## 0.8.3
396
+
397
+ ### Breaking changes:
398
+
399
+ * `Chewy.atomic` and `Chewy.urgent_update=` methods was removed from the codebase, use `Chewy.strategy` block instead.
400
+ * `delete_from_index?` hook is removed from the codebase.
401
+
402
+ ### Changes
403
+
404
+ * Sequel support completely reworked to use common ORM implementations + better sequel specs covarage.
405
+
406
+ ### Bugs Fixed
407
+
408
+ * Sequel objects transactional destruction fix
409
+ * Correct Rspec mocking framework checking ([@mainameiz][])
410
+ * Atomic strategy is now compatible with custom ids proc.
411
+ * Safe unsubscribe on import ([@marshall-lee][])
412
+ * Correct custom assets path silencer ([@davekaro][])
413
+
414
+ ## 0.8.2
415
+
416
+ ### Changes
417
+
418
+ * ActiveJob strategy by [@mkcode][]
419
+ * Async strategies tweak ([@AndreySavelyev][])
420
+ * GeoPoint readme ([@joonty][])
421
+ * Multiple grammar fixes and code improvements ([@biow0lf][])
422
+ * Named aggregations by [@caldwecr][]
423
+ * Sequel adapter by [@jirutka][]
424
+ * Rake helper methods extracted ([@caldwecr][], [@jirutka][])
425
+ * Multiple grammar fixes ([@henrebotha][])
426
+ * Ability to pass a proc to `update_index` to define updating index dynamically ([@SeTeM][])
427
+
428
+ ### Bugs Fixed
429
+
430
+ * Fixed transport logger and tracer configuration
431
+
432
+ ## 0.8.1
433
+
434
+ ### Bugs Fixed
435
+
436
+ * Added support of elasticsearch-ruby 1.0.10
437
+
438
+ ## 0.8.0
439
+
440
+ ### Breaking changes:
441
+
442
+ * `:atomic` and `:urgent` strategies are using `import!` method raising exceptions
443
+
444
+ ### Changes
445
+
446
+ * Crutches™ technology
447
+ * Added `.script_fields` chainable method to query ([@ka8725][])
448
+ * `update_index` matcher mocha support ([@lardawge][])
449
+ * `:resque` async strategy
450
+ * `:sidekiq` async strategy (inspired by [@sharkzp][])
451
+ * Added `Query#search_type` for `search_type` request option setup ([@marshall-lee][])
452
+
453
+ ### Bugs Fixed
454
+
455
+ * Rails 4.2 migrations are not raising UndefinedUpdateStrategy anymore on data updates
456
+ * Mongoid random failing specs fixes ([@marshall-lee][])
457
+
458
+ ## 0.7.0
459
+
460
+ ### Breaking changes:
461
+
462
+ * `Chewy.use_after_commit_callbacks = false` returns previous RDBMS behavior in tests
463
+ * ActiveRecord import is now called after_commit instead of after_save and after_destroy
464
+ * Import now respects default scope and removes unmatched documents
465
+ * `delete_from_index?` method is deprecated, use
139
466
  ```ruby
140
467
  define_type User, delete_if: ->{ removed? } do
141
468
  ...
142
469
  end
143
470
  ```
144
-
145
471
  * `Chewy.request_strategy` to configure action controller's request wrapping strategy
146
-
147
472
  * `Chewy.root_strategy` to configure the first strategy in stack
148
-
149
473
  * Default strategy for controller actions is `:atomic`
150
-
151
474
  * Default strategy for activerecord migrations is `:bypass`
152
-
153
475
  * Default strategy for sandbox console is `:bypass`
154
-
155
476
  * Default strategy for rails console is `:urgent`
156
-
157
477
  * `Chewy.configuration` was renamed to `Chewy.settings`
158
-
159
- * Reworked index update strategies implementation. `Chewy.atomic`
160
- and `Chewy.urgent_update` are now deprecated in favour of the new
161
- `Chewy.strategy` API.
162
-
163
- * Loading objects for object-sourced types using `wrap` method is
164
- deprecated, `load_one` method should be used instead. Or method name
165
- might be passed to `define_type`:
166
-
478
+ * Reworked index update strategies implementation. `Chewy.atomic` and `Chewy.urgent_update` are now deprecated in favour of the new `Chewy.strategy` API.
479
+ * 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`:
167
480
  ```ruby
168
481
  class GeoData
169
482
  def self.get_data(elasticsearch_document)
@@ -177,14 +490,11 @@
177
490
  end
178
491
  ```
179
492
 
180
- ## Changes
181
-
182
- * Multiple enhancements by @DNNX
183
-
184
- * Added `script_fields` to search criteria (@ka8725)
493
+ ### Changes
185
494
 
495
+ * Multiple enhancements by [@DNNX][]
496
+ * Added `script_fields` to search criteria ([@ka8725][])
186
497
  * 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.
187
-
188
498
  ```ruby
189
499
  define_type Country.where("rating > 30") do
190
500
 
@@ -197,11 +507,7 @@
197
507
  CountriesIndex::Country.import(Country.where("rating < 50").to_a)
198
508
  CountriesIndex::Country.import(Country.where("rating < 50").pluck(:id))
199
509
  ```
200
-
201
- * Object adapter supports custom initial import and load methods, so it
202
- could be configured to be used with procs or any class responding to `call`
203
- method.
204
-
510
+ * 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.
205
511
  ```ruby
206
512
  class GeoData
207
513
  def self.call
@@ -214,9 +520,7 @@
214
520
  ...
215
521
  end
216
522
  ```
217
-
218
523
  * Nested fields value procs additional arguments: parent objects.
219
-
220
524
  ```ruby
221
525
  define_type Country do
222
526
  field :name
@@ -225,177 +529,133 @@
225
529
  end
226
530
  end
227
531
  ```
228
-
229
532
  * Implemented basic named scopes
230
533
 
231
- ## Bugfixes
232
-
233
- * `script_score` allow options (@joeljunstrom)
234
-
235
- * Chewy indexes eaged loading fixes (@leemhenson)
534
+ ### Bugs Fixed
236
535
 
536
+ * `script_score` allow options ([@joeljunstrom][])
537
+ * Chewy indexes eaged loading fixes ([@leemhenson][])
237
538
  * `Chewy::Index.import nil` imports nothing instead of initial data
238
539
 
239
- # Version 0.6.2
540
+ ## 0.6.2
240
541
 
241
- ## Changes
542
+ ### Changes
242
543
 
243
- * document root id custom value option (@baronworks)
544
+ * document root id custom value option ([@baronworks][])
244
545
 
245
- ## Bugfixes
246
-
247
- * Removed decay function defaults (@Linuus)
546
+ ### Bugs Fixed
248
547
 
548
+ * Removed decay function defaults ([@Linuus][])
249
549
  * Correct config file handling in case of empty file
250
550
 
251
- # Version 0.6.1
252
-
253
- ## Changes
254
-
255
- * `min_score` query option support (@jshirley)
551
+ ## 0.6.1
256
552
 
257
- * `Chewy::Query#find` method for finding records by id
553
+ ### Changes
258
554
 
259
- # Version 0.6.0
555
+ * `min_score` query option support ([@jshirley][])
556
+ * `Chewy::Query#find` method for finding documents by id
260
557
 
261
- ## Changes
558
+ ## 0.6.0
262
559
 
263
- * Mongoid support YaY! (@fabiotomio, @leemhenson)
560
+ ### Changes
264
561
 
562
+ * Mongoid support YaY! ([@fabiotomio][], [@leemhenson][])
265
563
  * `urgent: true` option for `update_index` is deprecated and will be removed soon, use `Chewy.atomic` instead
564
+ * `timeout` and `timed_out` support ([@MarkMurphy][])
565
+ * will_paginate support ([@josecoelho][])
266
566
 
267
- * `timeout` and `timed_out` support (@MarkMurphy)
567
+ ### Bugs Fixed
268
568
 
269
- * will_paginate support (@josecoelho)
569
+ * All the query chainable methods delegated to indexes and types (partially [@Linuus][])
270
570
 
271
- ## Bugfixes
571
+ ## 0.5.2
272
572
 
273
- * All the query chainable methods delegated to indexes and types (partially @Linuus)
274
-
275
- # Version 0.5.2
276
-
277
- ## Incompatible changes:
573
+ ### Breaking changes:
278
574
 
279
575
  * `Chewy::Type::Base` removed in favour of using `Chewy::Type` as a base class for all types
280
576
 
281
- ## Changes
577
+ ### Changes
282
578
 
283
579
  * `Chewy.massacre` aliased to `Chewy.delete_all` method deletes all the indexes with current prefix
284
580
 
285
- ## Bugfixes:
286
-
287
- * Advanced type classes resolving (@inbeom)
581
+ ### Bugs Fixed:
288
582
 
583
+ * Advanced type classes resolving ([@inbeom][])
289
584
  * `import` ignores nil
290
585
 
291
- # Version 0.5.1
586
+ ## 0.5.1
292
587
 
293
- ## Changes:
294
-
295
- * `chewy.yml` Rails generator (@jirikolarik)
296
-
297
- * Parent-child mappings feature support (@inbeom)
588
+ ### Changes:
298
589
 
590
+ * `chewy.yml` Rails generator ([@jirikolarik][])
591
+ * Parent-child mappings feature support ([@inbeom][])
299
592
  * `Chewy::Index.total_count` and `Chewy::Type::Base.total_count`
593
+ * `Chewy::Type::Base.reset` method. Deletes all the type documents and performs import ([@jondavidford][])
594
+ * Added `Chewy::Query#delete_all` scope method using delete by query ES feature ([@jondavidford][])
595
+ * Rspec 3 `update_index` matcher support ([@jimmybaker][])
596
+ * Implemented function scoring ([@averell23][])
300
597
 
301
- * `Chewy::Type::Base.reset` method. Deletes all the type documents and performs import (@jondavidford)
302
-
303
- * Added `Chewy::Query#delete_all` scope method using delete by query ES feature (@jondavidford)
598
+ ### Bugs Fixed:
304
599
 
305
- * Rspec 3 `update_index` matcher support (@jimmybaker)
600
+ * Indexed eager-loading fix ([@leemhenson][])
601
+ * Field type deriving nested type support fix ([@rschellhorn][])
306
602
 
307
- * Implemented function scoring (@averell23)
603
+ ## 0.5.0
308
604
 
309
- ## Bugfixes:
310
-
311
- * Indexed eager-loading fix (@leemhenson)
312
-
313
- * Field type deriving nested type support fix (@rschellhorn)
314
-
315
- # Version 0.5.0
316
-
317
- ## Incompatible changes:
605
+ ### Breaking changes:
318
606
 
319
607
  * 404 exception (IndexMissingException) while query is swallowed and treated like an empty result set.
320
-
321
608
  * `load` and `preload` for queries became lazy. Might be partially incompatible.
322
-
323
609
  * 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)
324
610
 
325
- ## Changes:
326
-
327
- * `suggest` query options support (@rschellhorn).
611
+ ### Changes:
328
612
 
613
+ * `suggest` query options support ([@rschellhorn][]).
329
614
  * Added hash data support. How it is possible to pass hashes to import.
330
-
331
615
  * `rake chewy:reset` and `rake chewy:update` paramless acts as `rake chewy:reset:all` and `rake chewy:update:all` respectively
332
-
333
616
  * Added `delete_from_index?` API method for custom deleted objects marking.
334
-
335
617
  * Added `post_filter` API, working the same way as filters.
336
-
337
618
  * Added chainable `strategy` query method.
338
-
339
619
  * Aliasing is performed in index create request for ElasticSearch >= 1.1.
340
-
341
620
  * `preload` scope method loads ORM/ODM objects in background.
342
-
343
621
  * `load` method `:only` and `:except` options to specify load types.
344
-
345
622
  * `highlight` and `rescore` query options support.
346
-
347
623
  * config/chewy.yml ERB support.
348
624
 
349
- ## Bugfixes:
625
+ ### Bugs Fixed:
350
626
 
351
627
  * Fixed `missing` and `exists` filters DSL constructors.
352
-
353
628
  * Reworked index data composing.
354
-
355
- * Support for Kaminari new PaginatableArray behavior (@leemhenson)
356
-
629
+ * Support for Kaminari new PaginatableArray behavior ([@leemhenson][])
357
630
  * Correct waiting for status. After index creation, bulk import, and deletion.
631
+ * [#23](https://github.com/toptal/chewy/pull/23): Fix "wrong constant name" with namespace models
358
632
 
359
- * Fix #23 "wrong constant name" with namespace models
360
-
361
- # Version 0.4.0
633
+ ## 0.4.0
362
634
 
363
635
  * Changed `update_index` matcher behavior. Now it compare array attributes position-independently.
364
-
365
- * Search aggregations API support (@arion).
366
-
636
+ * Search aggregations API support ([@arion][]).
367
637
  * Chewy::Query#facets called without params performs the request and returns facets.
368
-
369
638
  * Added `Type.template` DSL method for root objects dynamic templates definition. See [mapping.rb](lib/chewy/type/mapping.rb) for more details.
370
-
371
- * ActiveRecord adapter custom `primary_key` support (@matthee).
372
-
639
+ * ActiveRecord adapter custom `primary_key` support ([@matthee][]).
373
640
  * Urgent update now clears association cache in ActiveRecord to ensure latest changes are imported.
374
-
375
641
  * `import` now creates index before performing.
376
-
377
642
  * `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.
378
643
 
379
- # Version 0.3.0
644
+ ## 0.3.0
380
645
 
381
646
  * Added `Chewy.configuration[:index]` config to setup common indexes options.
382
-
383
647
  * `Chewy.client_options` replaced with `Chewy.configuration`
384
-
385
648
  * Using source filtering instead of fields filter (http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-source-filtering.html).
386
649
 
387
- # Version 0.2.3
650
+ ## 0.2.3
388
651
 
389
652
  * `.import!` indexes method, raises import errors.
390
-
391
653
  * `.import!` types method, raises import errors. Useful for specs.
392
654
 
393
- # Version 0.2.2
394
-
395
- * Support for `none` scope (@undr).
396
-
397
- * Auto-resolved analyzers and analyzers repository (@webgago):
655
+ ## 0.2.2
398
656
 
657
+ * Support for `none` scope ([@undr][]).
658
+ * Auto-resolved analyzers and analyzers repository ([@webgago][]):
399
659
  ```ruby
400
660
  # Setting up analyzers repository:
401
661
  Chewy.analyzer :title_analyzer, type: 'custom', filter: %w(lowercase icu_folding title_nysiis)
@@ -406,69 +666,42 @@
406
666
  settings analysis: {analyzer: ['title_analyzer', {one_more_analyzer: {type: 'custom', tokenizer: 'lowercase'}}]}
407
667
  end
408
668
  ```
409
-
410
669
  `title_analyzer` here will be automatically resolved and passed to index mapping
411
670
 
412
- # Version 0.2.0
671
+ ## 0.2.0
413
672
 
414
673
  * 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.
415
-
416
674
  * `Chewy::Index.import` now takes types hash as argument within options hash:
417
675
 
418
676
  `PlacesIndex.import city: City.enabled, country: Country.enabled, refresh: false`
419
-
420
677
  * Old indexes cleanup after reset.
421
-
422
678
  * Added index prefixes.
423
-
424
679
  * `define_type` now takes options for adapter.
425
-
426
680
  * `chewy:reset` and `chewy:reset:all` rake tasks are now trying to reset index with zero downtime if it is possible.
427
-
428
681
  * Added `chewy:update:all` rake task.
429
-
430
682
  * 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.
431
-
432
683
  * Method `reset` renamed to `reset!`.
433
-
434
684
  * Added common loading scope for AR adapter. Also removed scope proc argument, now it executes just in main load scope context.
435
-
436
685
  `CitiesIndex.all.load(scope: {city: City.include(:country)})`
437
686
  `CitiesIndex.all.load(scope: {city: -> { include(:country) }})`
438
687
  `CitiesIndex.all.load(scope: ->{ include(:country) })`
439
688
 
440
- # Version 0.1.0
689
+ ## 0.1.0
441
690
 
442
691
  * Added filters simplified DSL. See [filters.rb](lib/chewy/query/filters.rb) for more details.
443
-
444
692
  * Queries and filters join system reworked. See [query.rb](lib/chewy/query.rb) for more details.
445
-
446
693
  * Added query `merge` method
447
-
448
- * `update_index` matcher now wraps expected block in `Chewy.atomic` by default.
449
- This behaviour can be prevented with `atomic: false` option passing
450
-
694
+ * `update_index` matcher now wraps expected block in `Chewy.atomic` by default. This behaviour can be prevented with `atomic: false` option passing
451
695
  ```ruby
452
696
  expect { user.save! }.to update_index('users#user', atomic: false)
453
697
  ```
454
-
455
698
  * Renamed `Chewy.observing_enabled` to `Chewy.urgent_update` with `false` as default
456
-
457
- * `update_elasticsearch` renamed to `update_index`, added `update_index`
458
- `:urgent` option
459
-
460
- * Added import ActiveSupport::Notifications instrumentation
461
- `ActiveSupport::Notifications.subscribe('import_objects.chewy') { |*args| }`
462
-
463
- * Added `types!` and `only!` query chain methods, which purges previously
464
- chained types and fields
465
-
699
+ * `update_elasticsearch` renamed to `update_index`, added `update_index` `:urgent` option
700
+ * Added import ActiveSupport::Notifications instrumentation `ActiveSupport::Notifications.subscribe('import_objects.chewy') { |*args| }`
701
+ * Added `types!` and `only!` query chain methods, which purges previously chained types and fields
466
702
  * `types` chain method now uses types filter
467
-
468
703
  * Added `types` query chain method
469
-
470
704
  * Changed types access API:
471
-
472
705
  ```ruby
473
706
  UsersIndex::User # => UsersIndex::User
474
707
  UsersIndex::types_hash['user'] # => UsersIndex::User
@@ -476,37 +709,113 @@
476
709
  UsersIndex.types # => [UsersIndex::User]
477
710
  UsersIndex.type_names # => ['user']
478
711
  ```
479
-
480
712
  * `update_elasticsearch` method name as the second argument
481
713
 
482
714
  ```ruby
483
715
  update_elasticsearch('users#user', :self)
484
716
  update_elasticsearch('users#user', :users)
485
717
  ```
486
-
487
- * Changed index handle methods, removed `index_` prefix. I.e. was
488
- `UsersIndex.index_create`, became `UsersIndex.create`
489
-
490
- * Ability to pass value proc for source object context if arity == 0
491
- `field :full_name, value: ->{ first_name + last_name }` instead of
492
- `field :full_name, value: ->(u){ u.first_name + u.last_name }`
493
-
718
+ * Changed index handle methods, removed `index_` prefix. I.e. was `UsersIndex.index_create`, became `UsersIndex.create`
719
+ * 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 }`
494
720
  * Added `.only` chain to `update_index` matcher
495
-
496
- * Added ability to pass ActiveRecord::Relation as a scope for load
497
- `CitiesIndex.all.load(scope: {city: City.include(:country)})`
498
-
721
+ * Added ability to pass ActiveRecord::Relation as a scope for load `CitiesIndex.all.load(scope: {city: City.include(:country)})`
499
722
  * Added method `all` to index for query DSL consistency
500
-
501
723
  * Implemented isolated adapters to simplify adding new ORMs
724
+ * Query DLS chainable methods delegated to index class (no longer need to call MyIndex.search.query, just MyIndex.query)
502
725
 
503
- * Query DLS chainable methods delegated to index class
504
- (no longer need to call MyIndex.search.query, just MyIndex.query)
505
-
506
- # Version 0.0.1
726
+ ## 0.0.1
507
727
 
508
728
  * Query DSL
509
-
510
729
  * Basic index handling
511
-
512
730
  * Initial version
731
+
732
+ [@0x0badc0de]: https://github.com/0x0badc0de
733
+ [@AgeevAndrew]: https://github.com/AgeevAndrew
734
+ [@aglushkov]: https://github.com/aglushkov
735
+ [@AlexVPopov]: https://github.com/AlexVPopov
736
+ [@AndreySavelyev]: https://github.com/AndreySavelyev
737
+ [@afg419]: https://github.com/afg419
738
+ [@arion]: https://github.com/arion
739
+ [@arturtr]: https://github.com/arturtr
740
+ [@averell23]: https://github.com/averell23
741
+ [@baronworks]: https://github.com/baronworks
742
+ [@barthez]: https://github.com/barthez
743
+ [@bbatsov]: https://github.com/bbatsov
744
+ [@bhacaz]: https://github.com/bhacaz
745
+ [@biow0lf]: https://github.com/biow0lf
746
+ [@Borzik]: https://github.com/Borzik
747
+ [@caldwecr]: https://github.com/caldwecr
748
+ [@chrisandreae]: https://github.com/chrisandreae
749
+ [@clupprich]: https://github.com/clupprich
750
+ [@dalthon]: https://github.com/dalthon
751
+ [@davekaro]: https://github.com/davekaro
752
+ [@dck]: https://github.com/dck
753
+ [@dm1try]: https://github.com/dm1try
754
+ [@dmitry]: https://github.com/dmitry
755
+ [@dnd]: https://github.com/dnd
756
+ [@DNNX]: https://github.com/DNNX
757
+ [@eManPrague]: https://github.com/eManPrague
758
+ [@eproulx-petalmd]: https://github.com/eproulx-petalmd
759
+ [@fabiotomio]: https://github.com/fabiotomio
760
+ [@feymartynov]: https://github.com/feymartynov
761
+ [@gseddon]: https://github.com/gseddon
762
+ [@guigs]: https://github.com/guigs
763
+ [@heartfulbird]: https://github.com/heartfulbird
764
+ [@henrebotha]: https://github.com/henrebotha
765
+ [@inbeom]: https://github.com/inbeom
766
+ [@jesjos]: https://github.com/jesjos
767
+ [@JF-Lalonde]: https://github.com/JF-Lalonde
768
+ [@jiajiawang]: https://github.com/jiajiawang
769
+ [@jimmybaker]: https://github.com/jimmybaker
770
+ [@jirikolarik]: https://github.com/jirikolarik
771
+ [@jirutka]: https://github.com/jirutka
772
+ [@jkostolansky]: https://github.com/jkostolansky
773
+ [@joeljunstrom]: https://github.com/joeljunstrom
774
+ [@jondavidford]: https://github.com/jondavidford
775
+ [@joonty]: https://github.com/joonty
776
+ [@josecoelho]: https://github.com/josecoelho
777
+ [@josephchoe]: https://github.com/josephchoe
778
+ [@jshirley]: https://github.com/jshirley
779
+ [@ka8725]: https://github.com/ka8725
780
+ [@kolauren]: https://github.com/kolauren
781
+ [@konalegi]: https://github.com/konalegi
782
+ [@lardawge]: https://github.com/lardawge
783
+ [@leemhenson]: https://github.com/leemhenson
784
+ [@Linuus]: https://github.com/Linuus
785
+ [@lowang]: https://github.com/lowang
786
+ [@mainameiz]: https://github.com/mainameiz
787
+ [@MarkMurphy]: https://github.com/MarkMurphy
788
+ [@marshall]: https://github.com/marshall
789
+ [@matchbookmac]: https://github.com/matchbookmac
790
+ [@matthee]: https://github.com/matthee
791
+ [@mattzollinhofer]: https://github.com/mattzollinhofer
792
+ [@menglewis]: https://github.com/menglewis
793
+ [@mikeyhogarth]: https://github.com/mikeyhogarth
794
+ [@milk1000cc]: https://github.com/milk1000cc
795
+ [@mkcode]: https://github.com/mkcode
796
+ [@mpeychich]: https://github.com/mpeychich
797
+ [@mrbrdo]: https://github.com/mrbrdo
798
+ [@mrzasa]: https://github.com/mrzasa
799
+ [@musaffa]: https://github.com/musaffa
800
+ [@nattfodd]: https://github.com/nattfodd
801
+ [@okliv]: https://github.com/okliv
802
+ [@olancheg]: https://github.com/olancheg
803
+ [@parallel588]: https://github.com/parallel588
804
+ [@pyromaniac]: https://github.com/pyromaniac
805
+ [@rabotyaga]: https://github.com/rabotyaga
806
+ [@reidab]: https://github.com/reidab
807
+ [@robacarp]: https://github.com/robacarp
808
+ [@robertasg]: https://github.com/robertasg
809
+ [@rschellhorn]: https://github.com/rschellhorn
810
+ [@sergey-kintsel]: https://github.com/sergey-kintsel
811
+ [@sergeygaychuk]: https://github.com/sergeygaychuk
812
+ [@SeTeM]: https://github.com/SeTeM
813
+ [@sevab]: https://github.com/sevab
814
+ [@sharkzp]: https://github.com/sharkzp
815
+ [@socialchorus]: https://github.com/socialchorus
816
+ [@taylor-au]: https://github.com/taylor-au
817
+ [@TikiTDO]: https://github.com/TikiTDO
818
+ [@undr]: https://github.com/undr
819
+ [@Vitalina-Vakulchyk]: https://github.com/Vitalina-Vakulchyk
820
+ [@webgago]: https://github.com/webgago
821
+ [@yahooguntu]: https://github.com/yahooguntu