elastomer-client 3.2.3 → 6.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.devcontainer/devcontainer.json +46 -0
- data/.devcontainer/postCreateCommand.sh +4 -0
- data/.github/dependabot.yaml +11 -0
- data/.github/workflows/main.yml +45 -0
- data/.github/workflows/rubocop.yml +15 -0
- data/.gitignore +1 -1
- data/.rubocop.yml +13 -65
- data/.ruby-version +1 -0
- data/CHANGELOG.md +76 -0
- data/Gemfile +18 -1
- data/README.md +110 -51
- data/Rakefile +3 -1
- data/docker/compose.yaml +71 -0
- data/docker/elasticsearch8plus.yml +13 -0
- data/docs/README.md +4 -5
- data/docs/bulk_indexing.md +1 -1
- data/docs/client.md +20 -33
- data/docs/cluster.md +8 -8
- data/docs/docs.md +5 -5
- data/docs/index.md +4 -4
- data/docs/multi_search.md +1 -1
- data/docs/notifications.md +3 -3
- data/docs/scan_scroll.md +1 -1
- data/docs/snapshots.md +1 -1
- data/docs/templates.md +1 -1
- data/elastomer-client.gemspec +7 -16
- data/lib/{elastomer → elastomer_client}/client/bulk.rb +70 -47
- data/lib/{elastomer → elastomer_client}/client/cluster.rb +18 -16
- data/lib/{elastomer → elastomer_client}/client/delete_by_query.rb +6 -4
- data/lib/{elastomer → elastomer_client}/client/docs.rb +82 -72
- data/lib/{elastomer → elastomer_client}/client/errors.rb +7 -17
- data/lib/{elastomer → elastomer_client}/client/index.rb +55 -79
- data/lib/{elastomer → elastomer_client}/client/multi_percolate.rb +7 -5
- data/lib/{elastomer → elastomer_client}/client/multi_search.rb +5 -3
- data/lib/{elastomer → elastomer_client}/client/native_delete_by_query.rb +6 -6
- data/lib/{elastomer → elastomer_client}/client/nodes.rb +11 -10
- data/lib/{elastomer → elastomer_client}/client/percolator.rb +9 -10
- data/lib/elastomer_client/client/reindex.rb +34 -0
- data/lib/{elastomer → elastomer_client}/client/repository.rb +7 -5
- data/lib/{elastomer → elastomer_client}/client/rest_api_spec/api_spec.rb +7 -6
- data/lib/{elastomer → elastomer_client}/client/rest_api_spec/api_spec_v5_6.rb +1 -1
- data/lib/elastomer_client/client/rest_api_spec/api_spec_v8_13.rb +7567 -0
- data/lib/elastomer_client/client/rest_api_spec/api_spec_v8_7.rb +6553 -0
- data/lib/{elastomer → elastomer_client}/client/rest_api_spec/rest_api.rb +5 -3
- data/lib/{elastomer → elastomer_client}/client/rest_api_spec.rb +3 -2
- data/lib/{elastomer → elastomer_client}/client/scroller.rb +17 -16
- data/lib/{elastomer → elastomer_client}/client/snapshot.rb +10 -8
- data/lib/{elastomer → elastomer_client}/client/tasks.rb +9 -13
- data/lib/{elastomer → elastomer_client}/client/template.rb +10 -9
- data/lib/elastomer_client/client/update_by_query.rb +50 -0
- data/lib/{elastomer → elastomer_client}/client.rb +51 -62
- data/lib/{elastomer → elastomer_client}/core_ext/time.rb +2 -0
- data/lib/{elastomer → elastomer_client}/middleware/compress.rb +2 -2
- data/lib/{elastomer → elastomer_client}/middleware/encode_json.rb +4 -2
- data/lib/{elastomer → elastomer_client}/middleware/limit_size.rb +5 -3
- data/lib/{elastomer → elastomer_client}/middleware/opaque_id.rb +10 -7
- data/lib/{elastomer → elastomer_client}/middleware/parse_json.rb +5 -3
- data/lib/{elastomer → elastomer_client}/notifications.rb +17 -15
- data/lib/elastomer_client/version.rb +9 -0
- data/lib/elastomer_client/version_support.rb +24 -0
- data/script/bootstrap +4 -2
- data/script/console +3 -1
- data/script/generate-rest-api-spec +77 -22
- data/test/assertions.rb +32 -39
- data/test/client/bulk_test.rb +166 -141
- data/test/client/cluster_test.rb +35 -13
- data/test/client/docs_test.rb +387 -274
- data/test/client/errors_test.rb +38 -40
- data/test/client/index_test.rb +243 -202
- data/test/client/multi_percolate_test.rb +46 -41
- data/test/client/multi_search_test.rb +122 -67
- data/test/client/native_delete_by_query_test.rb +96 -88
- data/test/client/nodes_test.rb +21 -10
- data/test/client/percolator_test.rb +19 -14
- data/test/client/reindex_test.rb +100 -0
- data/test/client/repository_test.rb +31 -19
- data/test/client/rest_api_spec/api_spec_test.rb +13 -11
- data/test/client/rest_api_spec/rest_api_test.rb +9 -7
- data/test/client/scroller_test.rb +44 -70
- data/test/client/snapshot_test.rb +38 -21
- data/test/client/stubbed_client_test.rb +7 -4
- data/test/client/tasks_test.rb +12 -17
- data/test/client/template_test.rb +34 -13
- data/test/client/update_by_query_test.rb +137 -0
- data/test/client_test.rb +158 -92
- data/test/core_ext/time_test.rb +14 -12
- data/test/middleware/encode_json_test.rb +18 -7
- data/test/middleware/opaque_id_test.rb +18 -14
- data/test/middleware/parse_json_test.rb +17 -9
- data/test/mock_response.rb +30 -0
- data/test/notifications_test.rb +15 -8
- data/test/test_helper.rb +40 -97
- data/test/version_support_test.rb +13 -78
- metadata +60 -208
- data/.overcommit.yml +0 -5
- data/.travis.yml +0 -34
- data/docker/docker-compose.cibuild.yml +0 -8
- data/docker/docker-compose.es24.yml +0 -34
- data/docker/docker-compose.es56.yml +0 -37
- data/docs/warmers.md +0 -3
- data/lib/elastomer/client/app_delete_by_query.rb +0 -144
- data/lib/elastomer/client/rest_api_spec/api_spec_v2_3.rb +0 -2232
- data/lib/elastomer/client/rest_api_spec/api_spec_v2_4.rb +0 -2250
- data/lib/elastomer/client/warmer.rb +0 -98
- data/lib/elastomer/version.rb +0 -7
- data/lib/elastomer/version_support.rb +0 -182
- data/script/cibuild +0 -103
- data/script/cibuild-elastomer-client +0 -1
- data/script/cibuild-elastomer-client-es24 +0 -8
- data/script/cibuild-elastomer-client-es56 +0 -8
- data/test/client/app_delete_by_query_test.rb +0 -192
- data/test/client/es_5_x_warmer_test.rb +0 -13
- 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:
|
4
|
+
version: 6.2.1
|
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:
|
12
|
+
date: 2024-12-11 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.
|
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.
|
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.
|
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.
|
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
|
-
|
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
|
-
- ".
|
101
|
+
- ".ruby-version"
|
244
102
|
- CHANGELOG.md
|
245
103
|
- Gemfile
|
246
104
|
- LICENSE.txt
|
247
105
|
- README.md
|
248
106
|
- Rakefile
|
249
|
-
- docker/
|
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/
|
267
|
-
- lib/
|
268
|
-
- lib/
|
269
|
-
- lib/
|
270
|
-
- lib/
|
271
|
-
- lib/
|
272
|
-
- lib/
|
273
|
-
- lib/
|
274
|
-
- lib/
|
275
|
-
- lib/
|
276
|
-
- lib/
|
277
|
-
- lib/
|
278
|
-
- lib/
|
279
|
-
- lib/
|
280
|
-
- lib/
|
281
|
-
- lib/
|
282
|
-
- lib/
|
283
|
-
- lib/
|
284
|
-
- lib/
|
285
|
-
- lib/
|
286
|
-
- lib/
|
287
|
-
- lib/
|
288
|
-
- lib/
|
289
|
-
- lib/
|
290
|
-
- lib/
|
291
|
-
- lib/
|
292
|
-
- lib/
|
293
|
-
- lib/
|
294
|
-
- lib/
|
295
|
-
- lib/
|
296
|
-
- lib/
|
297
|
-
- lib/
|
298
|
-
- lib/
|
299
|
-
- lib/
|
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/
|
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.
|
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/
|
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
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,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,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
|