searchkick 2.5.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE.md +7 -0
  3. data/.travis.yml +2 -11
  4. data/CHANGELOG.md +22 -0
  5. data/CONTRIBUTING.md +1 -1
  6. data/Gemfile +3 -3
  7. data/LICENSE.txt +1 -1
  8. data/README.md +68 -141
  9. data/Rakefile +0 -4
  10. data/benchmark/Gemfile +3 -2
  11. data/benchmark/{benchmark.rb → index.rb} +33 -31
  12. data/benchmark/search.rb +48 -0
  13. data/docs/Searchkick-3-Upgrade.md +57 -0
  14. data/lib/searchkick.rb +50 -27
  15. data/lib/searchkick/bulk_indexer.rb +168 -0
  16. data/lib/searchkick/bulk_reindex_job.rb +1 -1
  17. data/lib/searchkick/index.rb +122 -348
  18. data/lib/searchkick/index_options.rb +29 -26
  19. data/lib/searchkick/logging.rb +8 -7
  20. data/lib/searchkick/model.rb +37 -90
  21. data/lib/searchkick/multi_search.rb +6 -7
  22. data/lib/searchkick/query.rb +169 -166
  23. data/lib/searchkick/record_data.rb +133 -0
  24. data/lib/searchkick/record_indexer.rb +55 -0
  25. data/lib/searchkick/reindex_queue.rb +1 -1
  26. data/lib/searchkick/reindex_v2_job.rb +10 -13
  27. data/lib/searchkick/results.rb +14 -25
  28. data/lib/searchkick/tasks.rb +0 -4
  29. data/lib/searchkick/version.rb +1 -1
  30. data/searchkick.gemspec +3 -3
  31. data/test/boost_test.rb +3 -9
  32. data/test/geo_shape_test.rb +0 -4
  33. data/test/highlight_test.rb +28 -12
  34. data/test/index_test.rb +9 -10
  35. data/test/language_test.rb +16 -0
  36. data/test/marshal_test.rb +6 -1
  37. data/test/match_test.rb +9 -4
  38. data/test/model_test.rb +3 -5
  39. data/test/multi_search_test.rb +0 -7
  40. data/test/order_test.rb +1 -7
  41. data/test/pagination_test.rb +1 -1
  42. data/test/reindex_v2_job_test.rb +6 -11
  43. data/test/routing_test.rb +1 -1
  44. data/test/similar_test.rb +2 -2
  45. data/test/sql_test.rb +0 -31
  46. data/test/test_helper.rb +37 -23
  47. metadata +19 -26
  48. data/test/gemfiles/activerecord31.gemfile +0 -7
  49. data/test/gemfiles/activerecord32.gemfile +0 -7
  50. data/test/gemfiles/activerecord40.gemfile +0 -8
  51. data/test/gemfiles/activerecord41.gemfile +0 -8
  52. data/test/gemfiles/mongoid2.gemfile +0 -7
  53. data/test/gemfiles/mongoid3.gemfile +0 -6
  54. data/test/gemfiles/mongoid4.gemfile +0 -7
  55. data/test/records_test.rb +0 -10
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: searchkick
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-15 00:00:00.000000000 Z
11
+ date: 2018-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.1'
19
+ version: '4.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '4.1'
26
+ version: '4.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: elasticsearch
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1'
33
+ version: '5'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '1'
40
+ version: '5'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: hashie
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rake
70
+ name: minitest
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: minitest
84
+ name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -101,6 +101,7 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
+ - ".github/ISSUE_TEMPLATE.md"
104
105
  - ".gitignore"
105
106
  - ".travis.yml"
106
107
  - CHANGELOG.md
@@ -110,8 +111,11 @@ files:
110
111
  - README.md
111
112
  - Rakefile
112
113
  - benchmark/Gemfile
113
- - benchmark/benchmark.rb
114
+ - benchmark/index.rb
115
+ - benchmark/search.rb
116
+ - docs/Searchkick-3-Upgrade.md
114
117
  - lib/searchkick.rb
118
+ - lib/searchkick/bulk_indexer.rb
115
119
  - lib/searchkick/bulk_reindex_job.rb
116
120
  - lib/searchkick/hash_wrapper.rb
117
121
  - lib/searchkick/index.rb
@@ -124,6 +128,8 @@ files:
124
128
  - lib/searchkick/process_batch_job.rb
125
129
  - lib/searchkick/process_queue_job.rb
126
130
  - lib/searchkick/query.rb
131
+ - lib/searchkick/record_data.rb
132
+ - lib/searchkick/record_indexer.rb
127
133
  - lib/searchkick/reindex_queue.rb
128
134
  - lib/searchkick/reindex_v2_job.rb
129
135
  - lib/searchkick/results.rb
@@ -136,17 +142,10 @@ files:
136
142
  - test/callbacks_test.rb
137
143
  - test/ci/before_install.sh
138
144
  - test/errors_test.rb
139
- - test/gemfiles/activerecord31.gemfile
140
- - test/gemfiles/activerecord32.gemfile
141
- - test/gemfiles/activerecord40.gemfile
142
- - test/gemfiles/activerecord41.gemfile
143
145
  - test/gemfiles/activerecord42.gemfile
144
146
  - test/gemfiles/activerecord50.gemfile
145
147
  - test/gemfiles/apartment.gemfile
146
148
  - test/gemfiles/cequel.gemfile
147
- - test/gemfiles/mongoid2.gemfile
148
- - test/gemfiles/mongoid3.gemfile
149
- - test/gemfiles/mongoid4.gemfile
150
149
  - test/gemfiles/mongoid5.gemfile
151
150
  - test/gemfiles/mongoid6.gemfile
152
151
  - test/gemfiles/nobrainer.gemfile
@@ -155,6 +154,7 @@ files:
155
154
  - test/highlight_test.rb
156
155
  - test/index_test.rb
157
156
  - test/inheritance_test.rb
157
+ - test/language_test.rb
158
158
  - test/marshal_test.rb
159
159
  - test/match_test.rb
160
160
  - test/misspellings_test.rb
@@ -165,7 +165,6 @@ files:
165
165
  - test/pagination_test.rb
166
166
  - test/partial_reindex_test.rb
167
167
  - test/query_test.rb
168
- - test/records_test.rb
169
168
  - test/reindex_test.rb
170
169
  - test/reindex_v2_job_test.rb
171
170
  - test/routing_test.rb
@@ -205,24 +204,18 @@ summary: Searchkick learns what your users are looking for. As more people searc
205
204
  for your users.
206
205
  test_files:
207
206
  - benchmark/Gemfile
208
- - benchmark/benchmark.rb
207
+ - benchmark/index.rb
208
+ - benchmark/search.rb
209
209
  - test/aggs_test.rb
210
210
  - test/autocomplete_test.rb
211
211
  - test/boost_test.rb
212
212
  - test/callbacks_test.rb
213
213
  - test/ci/before_install.sh
214
214
  - test/errors_test.rb
215
- - test/gemfiles/activerecord31.gemfile
216
- - test/gemfiles/activerecord32.gemfile
217
- - test/gemfiles/activerecord40.gemfile
218
- - test/gemfiles/activerecord41.gemfile
219
215
  - test/gemfiles/activerecord42.gemfile
220
216
  - test/gemfiles/activerecord50.gemfile
221
217
  - test/gemfiles/apartment.gemfile
222
218
  - test/gemfiles/cequel.gemfile
223
- - test/gemfiles/mongoid2.gemfile
224
- - test/gemfiles/mongoid3.gemfile
225
- - test/gemfiles/mongoid4.gemfile
226
219
  - test/gemfiles/mongoid5.gemfile
227
220
  - test/gemfiles/mongoid6.gemfile
228
221
  - test/gemfiles/nobrainer.gemfile
@@ -231,6 +224,7 @@ test_files:
231
224
  - test/highlight_test.rb
232
225
  - test/index_test.rb
233
226
  - test/inheritance_test.rb
227
+ - test/language_test.rb
234
228
  - test/marshal_test.rb
235
229
  - test/match_test.rb
236
230
  - test/misspellings_test.rb
@@ -241,7 +235,6 @@ test_files:
241
235
  - test/pagination_test.rb
242
236
  - test/partial_reindex_test.rb
243
237
  - test/query_test.rb
244
- - test/records_test.rb
245
238
  - test/reindex_test.rb
246
239
  - test/reindex_v2_job_test.rb
247
240
  - test/routing_test.rb
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in searchkick.gemspec
4
- gemspec path: "../../"
5
-
6
- gem "sqlite3"
7
- gem "activerecord", "~> 3.1.0"
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in searchkick.gemspec
4
- gemspec path: "../../"
5
-
6
- gem "sqlite3"
7
- gem "activerecord", "~> 3.2.0"
@@ -1,8 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in searchkick.gemspec
4
- gemspec path: "../../"
5
-
6
- gem "sqlite3"
7
- gem "activerecord", "~> 4.0.0"
8
- gem "activejob_backport"
@@ -1,8 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in searchkick.gemspec
4
- gemspec path: "../../"
5
-
6
- gem "sqlite3"
7
- gem "activerecord", "~> 4.1.0"
8
- gem "activejob_backport"
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in searchkick.gemspec
4
- gemspec path: "../../"
5
-
6
- gem "mongoid", "~> 2"
7
- gem "bson_ext"
@@ -1,6 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in searchkick.gemspec
4
- gemspec path: "../../"
5
-
6
- gem "mongoid", "~> 3.1.0"
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in searchkick.gemspec
4
- gemspec path: "../../"
5
-
6
- gem "mongoid", "~> 4.0.0"
7
- gem "activejob_backport"
data/test/records_test.rb DELETED
@@ -1,10 +0,0 @@
1
- require_relative "test_helper"
2
-
3
- class RecordsTest < Minitest::Test
4
- def test_records
5
- skip if cequel?
6
-
7
- store_names ["Milk", "Apple"]
8
- assert_equal Product.search("milk").records.where(name: "Milk").count, 1
9
- end
10
- end