elastomer-client 3.2.2 → 6.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/.devcontainer/devcontainer.json +46 -0
  3. data/.devcontainer/postCreateCommand.sh +4 -0
  4. data/.github/dependabot.yaml +11 -0
  5. data/.github/workflows/main.yml +45 -0
  6. data/.github/workflows/rubocop.yml +15 -0
  7. data/.gitignore +1 -1
  8. data/.rubocop.yml +13 -65
  9. data/.ruby-version +1 -0
  10. data/CHANGELOG.md +76 -0
  11. data/Gemfile +18 -1
  12. data/README.md +110 -51
  13. data/Rakefile +3 -1
  14. data/docker/compose.yaml +71 -0
  15. data/docker/elasticsearch8plus.yml +13 -0
  16. data/docs/README.md +4 -5
  17. data/docs/bulk_indexing.md +1 -1
  18. data/docs/client.md +20 -33
  19. data/docs/cluster.md +8 -8
  20. data/docs/docs.md +5 -5
  21. data/docs/index.md +4 -4
  22. data/docs/multi_search.md +1 -1
  23. data/docs/notifications.md +3 -3
  24. data/docs/scan_scroll.md +1 -1
  25. data/docs/snapshots.md +1 -1
  26. data/docs/templates.md +1 -1
  27. data/elastomer-client.gemspec +7 -16
  28. data/lib/{elastomer → elastomer_client}/client/bulk.rb +70 -47
  29. data/lib/{elastomer → elastomer_client}/client/cluster.rb +18 -16
  30. data/lib/{elastomer → elastomer_client}/client/delete_by_query.rb +6 -4
  31. data/lib/{elastomer → elastomer_client}/client/docs.rb +82 -72
  32. data/lib/{elastomer → elastomer_client}/client/errors.rb +7 -17
  33. data/lib/{elastomer → elastomer_client}/client/index.rb +55 -79
  34. data/lib/{elastomer → elastomer_client}/client/multi_percolate.rb +7 -5
  35. data/lib/{elastomer → elastomer_client}/client/multi_search.rb +5 -3
  36. data/lib/{elastomer → elastomer_client}/client/native_delete_by_query.rb +6 -6
  37. data/lib/{elastomer → elastomer_client}/client/nodes.rb +11 -10
  38. data/lib/{elastomer → elastomer_client}/client/percolator.rb +9 -10
  39. data/lib/elastomer_client/client/reindex.rb +29 -0
  40. data/lib/{elastomer → elastomer_client}/client/repository.rb +7 -5
  41. data/lib/{elastomer → elastomer_client}/client/rest_api_spec/api_spec.rb +7 -6
  42. data/lib/{elastomer → elastomer_client}/client/rest_api_spec/api_spec_v5_6.rb +1 -1
  43. data/lib/elastomer_client/client/rest_api_spec/api_spec_v8_13.rb +7567 -0
  44. data/lib/elastomer_client/client/rest_api_spec/api_spec_v8_7.rb +6553 -0
  45. data/lib/{elastomer → elastomer_client}/client/rest_api_spec/rest_api.rb +6 -4
  46. data/lib/{elastomer → elastomer_client}/client/rest_api_spec.rb +3 -2
  47. data/lib/{elastomer → elastomer_client}/client/scroller.rb +17 -16
  48. data/lib/{elastomer → elastomer_client}/client/snapshot.rb +10 -8
  49. data/lib/{elastomer → elastomer_client}/client/tasks.rb +9 -13
  50. data/lib/{elastomer → elastomer_client}/client/template.rb +10 -9
  51. data/lib/elastomer_client/client/update_by_query.rb +50 -0
  52. data/lib/{elastomer → elastomer_client}/client.rb +51 -62
  53. data/lib/{elastomer → elastomer_client}/core_ext/time.rb +2 -0
  54. data/lib/{elastomer → elastomer_client}/middleware/compress.rb +2 -2
  55. data/lib/{elastomer → elastomer_client}/middleware/encode_json.rb +4 -2
  56. data/lib/{elastomer → elastomer_client}/middleware/limit_size.rb +5 -3
  57. data/lib/{elastomer → elastomer_client}/middleware/opaque_id.rb +10 -7
  58. data/lib/{elastomer → elastomer_client}/middleware/parse_json.rb +5 -3
  59. data/lib/{elastomer → elastomer_client}/notifications.rb +17 -15
  60. data/lib/elastomer_client/version.rb +9 -0
  61. data/lib/elastomer_client/version_support.rb +24 -0
  62. data/script/bootstrap +4 -2
  63. data/script/console +3 -1
  64. data/script/generate-rest-api-spec +77 -22
  65. data/test/assertions.rb +32 -39
  66. data/test/client/bulk_test.rb +165 -143
  67. data/test/client/cluster_test.rb +35 -13
  68. data/test/client/docs_test.rb +387 -274
  69. data/test/client/errors_test.rb +38 -40
  70. data/test/client/index_test.rb +243 -202
  71. data/test/client/multi_percolate_test.rb +46 -41
  72. data/test/client/multi_search_test.rb +122 -67
  73. data/test/client/native_delete_by_query_test.rb +96 -88
  74. data/test/client/nodes_test.rb +21 -10
  75. data/test/client/percolator_test.rb +19 -14
  76. data/test/client/reindex_test.rb +76 -0
  77. data/test/client/repository_test.rb +31 -19
  78. data/test/client/rest_api_spec/api_spec_test.rb +13 -11
  79. data/test/client/rest_api_spec/rest_api_test.rb +9 -7
  80. data/test/client/scroller_test.rb +44 -70
  81. data/test/client/snapshot_test.rb +38 -21
  82. data/test/client/stubbed_client_test.rb +7 -4
  83. data/test/client/tasks_test.rb +12 -17
  84. data/test/client/template_test.rb +34 -13
  85. data/test/client/update_by_query_test.rb +137 -0
  86. data/test/client_test.rb +158 -92
  87. data/test/core_ext/time_test.rb +14 -12
  88. data/test/middleware/encode_json_test.rb +18 -7
  89. data/test/middleware/opaque_id_test.rb +18 -14
  90. data/test/middleware/parse_json_test.rb +17 -9
  91. data/test/mock_response.rb +30 -0
  92. data/test/notifications_test.rb +15 -8
  93. data/test/test_helper.rb +40 -97
  94. data/test/version_support_test.rb +13 -78
  95. metadata +60 -208
  96. data/.overcommit.yml +0 -5
  97. data/.travis.yml +0 -34
  98. data/docker/docker-compose.cibuild.yml +0 -8
  99. data/docker/docker-compose.es24.yml +0 -34
  100. data/docker/docker-compose.es56.yml +0 -37
  101. data/docs/warmers.md +0 -3
  102. data/lib/elastomer/client/app_delete_by_query.rb +0 -144
  103. data/lib/elastomer/client/rest_api_spec/api_spec_v2_3.rb +0 -2232
  104. data/lib/elastomer/client/rest_api_spec/api_spec_v2_4.rb +0 -2250
  105. data/lib/elastomer/client/warmer.rb +0 -98
  106. data/lib/elastomer/version.rb +0 -7
  107. data/lib/elastomer/version_support.rb +0 -182
  108. data/script/cibuild +0 -103
  109. data/script/cibuild-elastomer-client +0 -1
  110. data/script/cibuild-elastomer-client-es24 +0 -8
  111. data/script/cibuild-elastomer-client-es56 +0 -8
  112. data/test/client/app_delete_by_query_test.rb +0 -192
  113. data/test/client/es_5_x_warmer_test.rb +0 -13
  114. data/test/client/warmer_test.rb +0 -60
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastomer-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.2
4
+ version: 6.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Pease
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-02-25 00:00:00.000000000 Z
12
+ date: 2024-11-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: addressable
@@ -29,30 +29,30 @@ dependencies:
29
29
  name: faraday
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - "~>"
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: '0.8'
34
+ version: '0.17'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - "~>"
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: '0.8'
41
+ version: '0.17'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: faraday_middleware
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - "~>"
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: '0.12'
48
+ version: '0.14'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - "~>"
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: '0.12'
55
+ version: '0.14'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: multi_json
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -81,154 +81,8 @@ dependencies:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
83
  version: '1.6'
84
- - !ruby/object:Gem::Dependency
85
- name: bundler
86
- requirement: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - "~>"
89
- - !ruby/object:Gem::Version
90
- version: '2.0'
91
- type: :development
92
- prerelease: false
93
- version_requirements: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - "~>"
96
- - !ruby/object:Gem::Version
97
- version: '2.0'
98
- - !ruby/object:Gem::Dependency
99
- name: activesupport
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - ">="
103
- - !ruby/object:Gem::Version
104
- version: '3.0'
105
- type: :development
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - ">="
110
- - !ruby/object:Gem::Version
111
- version: '3.0'
112
- - !ruby/object:Gem::Dependency
113
- name: minitest
114
- requirement: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - "~>"
117
- - !ruby/object:Gem::Version
118
- version: '5.10'
119
- type: :development
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - "~>"
124
- - !ruby/object:Gem::Version
125
- version: '5.10'
126
- - !ruby/object:Gem::Dependency
127
- name: minitest-fail-fast
128
- requirement: !ruby/object:Gem::Requirement
129
- requirements:
130
- - - "~>"
131
- - !ruby/object:Gem::Version
132
- version: 0.1.0
133
- type: :development
134
- prerelease: false
135
- version_requirements: !ruby/object:Gem::Requirement
136
- requirements:
137
- - - "~>"
138
- - !ruby/object:Gem::Version
139
- version: 0.1.0
140
- - !ruby/object:Gem::Dependency
141
- name: minitest-focus
142
- requirement: !ruby/object:Gem::Requirement
143
- requirements:
144
- - - "~>"
145
- - !ruby/object:Gem::Version
146
- version: '1.1'
147
- - - ">="
148
- - !ruby/object:Gem::Version
149
- version: 1.1.2
150
- type: :development
151
- prerelease: false
152
- version_requirements: !ruby/object:Gem::Requirement
153
- requirements:
154
- - - "~>"
155
- - !ruby/object:Gem::Version
156
- version: '1.1'
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: 1.1.2
160
- - !ruby/object:Gem::Dependency
161
- name: webmock
162
- requirement: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - "~>"
165
- - !ruby/object:Gem::Version
166
- version: '3.5'
167
- type: :development
168
- prerelease: false
169
- version_requirements: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - "~>"
172
- - !ruby/object:Gem::Version
173
- version: '3.5'
174
- - !ruby/object:Gem::Dependency
175
- name: awesome_print
176
- requirement: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - "~>"
179
- - !ruby/object:Gem::Version
180
- version: '1.8'
181
- type: :development
182
- prerelease: false
183
- version_requirements: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - "~>"
186
- - !ruby/object:Gem::Version
187
- version: '1.8'
188
- - !ruby/object:Gem::Dependency
189
- name: pry-byebug
190
- requirement: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - "~>"
193
- - !ruby/object:Gem::Version
194
- version: '3.4'
195
- type: :development
196
- prerelease: false
197
- version_requirements: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - "~>"
200
- - !ruby/object:Gem::Version
201
- version: '3.4'
202
- - !ruby/object:Gem::Dependency
203
- name: spy
204
- requirement: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - "~>"
207
- - !ruby/object:Gem::Version
208
- version: '1.0'
209
- type: :development
210
- prerelease: false
211
- version_requirements: !ruby/object:Gem::Requirement
212
- requirements:
213
- - - "~>"
214
- - !ruby/object:Gem::Version
215
- version: '1.0'
216
- - !ruby/object:Gem::Dependency
217
- name: rake
218
- requirement: !ruby/object:Gem::Requirement
219
- requirements:
220
- - - ">="
221
- - !ruby/object:Gem::Version
222
- version: '0'
223
- type: :development
224
- prerelease: false
225
- version_requirements: !ruby/object:Gem::Requirement
226
- requirements:
227
- - - ">="
228
- - !ruby/object:Gem::Version
229
- version: '0'
230
84
  description: |-
231
- Elastomer is a low level API client for the
85
+ ElastomerClient is a low level API client for the
232
86
  Elasticsearch HTTP interface.
233
87
  email:
234
88
  - tim.pease@github.com
@@ -237,19 +91,22 @@ executables: []
237
91
  extensions: []
238
92
  extra_rdoc_files: []
239
93
  files:
94
+ - ".devcontainer/devcontainer.json"
95
+ - ".devcontainer/postCreateCommand.sh"
96
+ - ".github/dependabot.yaml"
97
+ - ".github/workflows/main.yml"
98
+ - ".github/workflows/rubocop.yml"
240
99
  - ".gitignore"
241
- - ".overcommit.yml"
242
100
  - ".rubocop.yml"
243
- - ".travis.yml"
101
+ - ".ruby-version"
244
102
  - CHANGELOG.md
245
103
  - Gemfile
246
104
  - LICENSE.txt
247
105
  - README.md
248
106
  - Rakefile
249
- - docker/docker-compose.cibuild.yml
250
- - docker/docker-compose.es24.yml
251
- - docker/docker-compose.es56.yml
107
+ - docker/compose.yaml
252
108
  - docker/elasticsearch.yml
109
+ - docker/elasticsearch8plus.yml
253
110
  - docs/README.md
254
111
  - docs/bulk_indexing.md
255
112
  - docs/client.md
@@ -261,63 +118,57 @@ files:
261
118
  - docs/scan_scroll.md
262
119
  - docs/snapshots.md
263
120
  - docs/templates.md
264
- - docs/warmers.md
265
121
  - elastomer-client.gemspec
266
- - lib/elastomer/client.rb
267
- - lib/elastomer/client/app_delete_by_query.rb
268
- - lib/elastomer/client/bulk.rb
269
- - lib/elastomer/client/cluster.rb
270
- - lib/elastomer/client/delete_by_query.rb
271
- - lib/elastomer/client/docs.rb
272
- - lib/elastomer/client/errors.rb
273
- - lib/elastomer/client/index.rb
274
- - lib/elastomer/client/multi_percolate.rb
275
- - lib/elastomer/client/multi_search.rb
276
- - lib/elastomer/client/native_delete_by_query.rb
277
- - lib/elastomer/client/nodes.rb
278
- - lib/elastomer/client/percolator.rb
279
- - lib/elastomer/client/repository.rb
280
- - lib/elastomer/client/rest_api_spec.rb
281
- - lib/elastomer/client/rest_api_spec/api_spec.rb
282
- - lib/elastomer/client/rest_api_spec/api_spec_v2_3.rb
283
- - lib/elastomer/client/rest_api_spec/api_spec_v2_4.rb
284
- - lib/elastomer/client/rest_api_spec/api_spec_v5_6.rb
285
- - lib/elastomer/client/rest_api_spec/rest_api.rb
286
- - lib/elastomer/client/scroller.rb
287
- - lib/elastomer/client/snapshot.rb
288
- - lib/elastomer/client/tasks.rb
289
- - lib/elastomer/client/template.rb
290
- - lib/elastomer/client/warmer.rb
291
- - lib/elastomer/core_ext/time.rb
292
- - lib/elastomer/middleware/compress.rb
293
- - lib/elastomer/middleware/encode_json.rb
294
- - lib/elastomer/middleware/limit_size.rb
295
- - lib/elastomer/middleware/opaque_id.rb
296
- - lib/elastomer/middleware/parse_json.rb
297
- - lib/elastomer/notifications.rb
298
- - lib/elastomer/version.rb
299
- - lib/elastomer/version_support.rb
122
+ - lib/elastomer_client/client.rb
123
+ - lib/elastomer_client/client/bulk.rb
124
+ - lib/elastomer_client/client/cluster.rb
125
+ - lib/elastomer_client/client/delete_by_query.rb
126
+ - lib/elastomer_client/client/docs.rb
127
+ - lib/elastomer_client/client/errors.rb
128
+ - lib/elastomer_client/client/index.rb
129
+ - lib/elastomer_client/client/multi_percolate.rb
130
+ - lib/elastomer_client/client/multi_search.rb
131
+ - lib/elastomer_client/client/native_delete_by_query.rb
132
+ - lib/elastomer_client/client/nodes.rb
133
+ - lib/elastomer_client/client/percolator.rb
134
+ - lib/elastomer_client/client/reindex.rb
135
+ - lib/elastomer_client/client/repository.rb
136
+ - lib/elastomer_client/client/rest_api_spec.rb
137
+ - lib/elastomer_client/client/rest_api_spec/api_spec.rb
138
+ - lib/elastomer_client/client/rest_api_spec/api_spec_v5_6.rb
139
+ - lib/elastomer_client/client/rest_api_spec/api_spec_v8_13.rb
140
+ - lib/elastomer_client/client/rest_api_spec/api_spec_v8_7.rb
141
+ - lib/elastomer_client/client/rest_api_spec/rest_api.rb
142
+ - lib/elastomer_client/client/scroller.rb
143
+ - lib/elastomer_client/client/snapshot.rb
144
+ - lib/elastomer_client/client/tasks.rb
145
+ - lib/elastomer_client/client/template.rb
146
+ - lib/elastomer_client/client/update_by_query.rb
147
+ - lib/elastomer_client/core_ext/time.rb
148
+ - lib/elastomer_client/middleware/compress.rb
149
+ - lib/elastomer_client/middleware/encode_json.rb
150
+ - lib/elastomer_client/middleware/limit_size.rb
151
+ - lib/elastomer_client/middleware/opaque_id.rb
152
+ - lib/elastomer_client/middleware/parse_json.rb
153
+ - lib/elastomer_client/notifications.rb
154
+ - lib/elastomer_client/version.rb
155
+ - lib/elastomer_client/version_support.rb
300
156
  - script/bootstrap
301
- - script/cibuild
302
- - script/cibuild-elastomer-client
303
- - script/cibuild-elastomer-client-es24
304
- - script/cibuild-elastomer-client-es56
305
157
  - script/console
306
158
  - script/generate-rest-api-spec
307
159
  - script/poll-for-es
308
160
  - test/assertions.rb
309
- - test/client/app_delete_by_query_test.rb
310
161
  - test/client/bulk_test.rb
311
162
  - test/client/cluster_test.rb
312
163
  - test/client/docs_test.rb
313
164
  - test/client/errors_test.rb
314
- - test/client/es_5_x_warmer_test.rb
315
165
  - test/client/index_test.rb
316
166
  - test/client/multi_percolate_test.rb
317
167
  - test/client/multi_search_test.rb
318
168
  - test/client/native_delete_by_query_test.rb
319
169
  - test/client/nodes_test.rb
320
170
  - test/client/percolator_test.rb
171
+ - test/client/reindex_test.rb
321
172
  - test/client/repository_test.rb
322
173
  - test/client/rest_api_spec/api_spec_test.rb
323
174
  - test/client/rest_api_spec/rest_api_test.rb
@@ -326,12 +177,13 @@ files:
326
177
  - test/client/stubbed_client_test.rb
327
178
  - test/client/tasks_test.rb
328
179
  - test/client/template_test.rb
329
- - test/client/warmer_test.rb
180
+ - test/client/update_by_query_test.rb
330
181
  - test/client_test.rb
331
182
  - test/core_ext/time_test.rb
332
183
  - test/middleware/encode_json_test.rb
333
184
  - test/middleware/opaque_id_test.rb
334
185
  - test/middleware/parse_json_test.rb
186
+ - test/mock_response.rb
335
187
  - test/notifications_test.rb
336
188
  - test/test_helper.rb
337
189
  - test/version_support_test.rb
@@ -354,24 +206,23 @@ required_rubygems_version: !ruby/object:Gem::Requirement
354
206
  - !ruby/object:Gem::Version
355
207
  version: '0'
356
208
  requirements: []
357
- rubygems_version: 3.0.3
209
+ rubygems_version: 3.4.10
358
210
  signing_key:
359
211
  specification_version: 4
360
212
  summary: A library for interacting with Elasticsearch
361
213
  test_files:
362
214
  - test/assertions.rb
363
- - test/client/app_delete_by_query_test.rb
364
215
  - test/client/bulk_test.rb
365
216
  - test/client/cluster_test.rb
366
217
  - test/client/docs_test.rb
367
218
  - test/client/errors_test.rb
368
- - test/client/es_5_x_warmer_test.rb
369
219
  - test/client/index_test.rb
370
220
  - test/client/multi_percolate_test.rb
371
221
  - test/client/multi_search_test.rb
372
222
  - test/client/native_delete_by_query_test.rb
373
223
  - test/client/nodes_test.rb
374
224
  - test/client/percolator_test.rb
225
+ - test/client/reindex_test.rb
375
226
  - test/client/repository_test.rb
376
227
  - test/client/rest_api_spec/api_spec_test.rb
377
228
  - test/client/rest_api_spec/rest_api_test.rb
@@ -380,12 +231,13 @@ test_files:
380
231
  - test/client/stubbed_client_test.rb
381
232
  - test/client/tasks_test.rb
382
233
  - test/client/template_test.rb
383
- - test/client/warmer_test.rb
234
+ - test/client/update_by_query_test.rb
384
235
  - test/client_test.rb
385
236
  - test/core_ext/time_test.rb
386
237
  - test/middleware/encode_json_test.rb
387
238
  - test/middleware/opaque_id_test.rb
388
239
  - test/middleware/parse_json_test.rb
240
+ - test/mock_response.rb
389
241
  - test/notifications_test.rb
390
242
  - test/test_helper.rb
391
243
  - test/version_support_test.rb
data/.overcommit.yml DELETED
@@ -1,5 +0,0 @@
1
- PreCommit:
2
- RuboCop:
3
- enabled: true
4
- problem_on_unmodified_line: ignore
5
- flags: ['--fail-level', 'error', '--format', 'emacs']
data/.travis.yml DELETED
@@ -1,34 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.3.8
4
- env:
5
- # NOTE: Ancient versions of Elasticsearch have different download URLs
6
- - ES_VERSION=2.3.5 ES_DOWNLOAD_URL=https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/${ES_VERSION}/elasticsearch-${ES_VERSION}.tar.gz
7
- - ES_VERSION=2.4.6 ES_DOWNLOAD_URL=https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/${ES_VERSION}/elasticsearch-${ES_VERSION}.tar.gz
8
- - ES_VERSION=5.6.15 ES_DOWNLOAD_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz
9
-
10
- # Configure a specific version of Elasticsearch
11
- # See: https://docs.travis-ci.com/user/database-setup/#Installing-ElasticSearch-on-trusty-container-based-infrastructure
12
- install:
13
- # - sudo apt install openjdk-8-jdk
14
- # - sudo update-java-alternatives -l
15
- - wget ${ES_DOWNLOAD_URL}
16
- - tar -xzf elasticsearch-${ES_VERSION}.tar.gz
17
- - ./elasticsearch-${ES_VERSION}/bin/elasticsearch &
18
- - gem install bundler
19
- - bundle install
20
- - wget --quiet --waitretry=1 --retry-connrefused --timeout=10 --output-document=- http://127.0.0.1:9200
21
-
22
- script: bundle exec rake test
23
-
24
- notifications:
25
- email: false
26
-
27
- sudo: false
28
- dist: trusty
29
- jdk:
30
- - oraclejdk8
31
- addons:
32
- apt:
33
- packages:
34
- - oracle-java8-installer
@@ -1,8 +0,0 @@
1
- version: "2.1"
2
-
3
- networks:
4
- default:
5
- ipam:
6
- config:
7
- - subnet: 192.168.0.0/26
8
- gateway: 192.168.0.1
@@ -1,34 +0,0 @@
1
- version: "2.1"
2
-
3
- services:
4
- elasticsearch2.4:
5
- image: elasticsearch:2.4.6
6
- container_name: es2.4
7
- environment:
8
- - cluster.name=elastomer2.4
9
- - bootstrap.memory_lock=true
10
- - discovery.type=single-node
11
- - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
12
- ulimits:
13
- memlock:
14
- soft: -1
15
- hard: -1
16
- nofile:
17
- soft: 65536
18
- hard: 65536
19
- mem_limit: 1g
20
- cap_add:
21
- - IPC_LOCK
22
- volumes:
23
- - esrepos:/usr/share/elasticsearch/repos
24
- - ./elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
25
- ports:
26
- - 127.0.0.1:19200:9200
27
-
28
- volumes:
29
- esrepos:
30
- driver: local
31
- driver_opts:
32
- device: tmpfs
33
- type: tmpfs
34
- o: size=100m,uid=102,gid=102
@@ -1,37 +0,0 @@
1
- version: "2.1"
2
-
3
- services:
4
- elasticsearch5.6:
5
- image: docker.elastic.co/elasticsearch/elasticsearch:5.6.4
6
- container_name: es5.6
7
- environment:
8
- - cluster.name=elastomer5.6
9
- - bootstrap.memory_lock=true
10
- - discovery.type=single-node
11
- - xpack.monitoring.enabled=false
12
- - xpack.security.enabled=false
13
- - xpack.watcher.enabled=false
14
- - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
15
- ulimits:
16
- memlock:
17
- soft: -1
18
- hard: -1
19
- nofile:
20
- soft: 65536
21
- hard: 65536
22
- mem_limit: 1g
23
- cap_add:
24
- - IPC_LOCK
25
- volumes:
26
- - esrepos:/usr/share/elasticsearch/repos
27
- - ./elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
28
- ports:
29
- - 127.0.0.1:19200:9200
30
-
31
- volumes:
32
- esrepos:
33
- driver: local
34
- driver_opts:
35
- device: tmpfs
36
- type: tmpfs
37
- o: size=100m,uid=102,gid=102
data/docs/warmers.md DELETED
@@ -1,3 +0,0 @@
1
- # Elastomer Warmers Component
2
-
3
- ![constructocat](https://octodex.github.com/images/constructocat2.jpg)
@@ -1,144 +0,0 @@
1
- module Elastomer
2
- class Client
3
-
4
- # DEPRECATED: Delete documents from one or more indices and one or more
5
- # types based on a query.
6
- #
7
- # The return value follows the format returned by the Elasticsearch Delete
8
- # by Query plugin: https://github.com/elastic/elasticsearch/blob/v2.4.6/docs/plugins/delete-by-query.asciidoc
9
- #
10
- # Internally, this method uses a combination of scroll and bulk delete
11
- # instead of the Delete by Query API, which was removed in Elasticsearch
12
- # 2.0.
13
- #
14
- # For native _delete_by_query functionality in Elasticsearch 5+, see the
15
- # native_delete_by_query method.
16
- #
17
- # query - The query body as a Hash
18
- # params - Parameters Hash
19
- #
20
- # Examples
21
- #
22
- # # request body query
23
- # app_delete_by_query({:query => {:match_all => {}}}, :type => 'tweet')
24
- #
25
- # # same thing but using the URI request method
26
- # app_delete_by_query(nil, { :q => '*:*', :type => 'tweet' })
27
- #
28
- # See https://www.elastic.co/guide/en/elasticsearch/plugins/current/delete-by-query-usage.html
29
- #
30
- # Returns a Hash of statistics about the delete operations, for example:
31
- #
32
- # {
33
- # "took" : 639,
34
- # "_indices" : {
35
- # "_all" : {
36
- # "found" : 5901,
37
- # "deleted" : 5901,
38
- # "missing" : 0,
39
- # "failed" : 0
40
- # },
41
- # "twitter" : {
42
- # "found" : 5901,
43
- # "deleted" : 5901,
44
- # "missing" : 0,
45
- # "failed" : 0
46
- # }
47
- # },
48
- # "failures" : [ ]
49
- # }
50
- def app_delete_by_query(query, params = {})
51
- AppDeleteByQuery.new(self, query, params).execute
52
- end
53
-
54
- class AppDeleteByQuery
55
-
56
- # Create a new DeleteByQuery command for deleting documents matching a
57
- # query
58
- #
59
- # client - Elastomer::Client used for HTTP requests to the server
60
- # query - The query used to find documents to delete
61
- # params - Other URL parameters
62
- def initialize(client, query, params = {})
63
- @client = client
64
- @query = query
65
- @params = params
66
- @response_stats = { "took" => 0, "_indices" => { "_all" => {} }, "failures" => [] }
67
- end
68
-
69
- attr_reader :client, :query, :params, :response_stats
70
-
71
- # Internal: Determine whether or not an HTTP status code is in the range
72
- # 200 to 299
73
- #
74
- # status - HTTP status code
75
- #
76
- # Returns a boolean
77
- def is_ok?(status)
78
- status.between?(200, 299)
79
- end
80
-
81
- # Internal: Tally the contributions of an item to the found, deleted,
82
- # missing, and failed counts for the summary statistics
83
- #
84
- # item - An element of the items array from a bulk response
85
- #
86
- # Returns a Hash of counts for each category
87
- def categorize(item)
88
- {
89
- "found" => item["found"] || item["status"] == 409 ? 1 : 0,
90
- "deleted" => is_ok?(item["status"]) ? 1 : 0,
91
- "missing" => !item["found"] && !item.key?("error") ? 1 : 0,
92
- "failed" => item.key?("error") ? 1 : 0,
93
- }
94
- end
95
-
96
- # Internal: Combine a response item with the existing statistics
97
- #
98
- # item - A bulk response item
99
- def accumulate(item)
100
- item = item["delete"]
101
- (@response_stats["_indices"][item["_index"]] ||= {}).merge!(categorize(item)) { |_, n, m| n + m }
102
- @response_stats["_indices"]["_all"].merge!(categorize(item)) { |_, n, m| n + m }
103
- @response_stats["failures"] << item unless is_ok? item["status"]
104
- end
105
-
106
- # Perform the Delete by Query action
107
- #
108
- # Returns a Hash of statistics about the bulk operation
109
- def execute
110
- ops = Enumerator.new do |yielder|
111
- scan = @client.scan(@query, search_params)
112
- scan.each_document do |hit|
113
- yielder.yield([:delete, hit.select { |key, _| ["_index", "_type", "_id", "_routing"].include?(key) }])
114
- end
115
- end
116
-
117
- stats = @client.bulk_stream_items(ops, bulk_params) { |item| accumulate(item) }
118
- @response_stats["took"] = stats["took"]
119
- @response_stats
120
- end
121
-
122
- # Internal: Remove parameters that are not valid for the _search endpoint
123
- def search_params
124
- return @search_params if defined?(@search_params)
125
-
126
- @search_params = @params.merge(_source: false)
127
- @search_params.delete(:action_count)
128
- @search_params
129
- end
130
-
131
- # Internal: Remove parameters that are not valid for the _bulk endpoint
132
- def bulk_params
133
- return @bulk_params if defined?(@bulk_params)
134
-
135
- @bulk_params = @params.dup
136
- return @bulk_params if @bulk_params.nil?
137
-
138
- @bulk_params.delete(:q)
139
- @bulk_params
140
- end
141
-
142
- end
143
- end
144
- end