es-elasticity 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +3 -3
- data/CHANGELOG.md +7 -1
- data/Gemfile.lock +22 -41
- data/README.md +1 -1
- data/es-elasticity.gemspec +2 -1
- data/lib/elasticity/base_document.rb +0 -2
- data/lib/elasticity/bulk.rb +0 -2
- data/lib/elasticity/config.rb +0 -2
- data/lib/elasticity/document.rb +0 -2
- data/lib/elasticity/index_config.rb +0 -2
- data/lib/elasticity/index_mapper.rb +0 -2
- data/lib/elasticity/instrumented_client.rb +0 -2
- data/lib/elasticity/log_subscriber.rb +0 -2
- data/lib/elasticity/multi_search.rb +0 -2
- data/lib/elasticity/multi_search_response_parser.rb +1 -3
- data/lib/elasticity/railtie.rb +0 -2
- data/lib/elasticity/search.rb +0 -2
- data/lib/elasticity/segmented_document.rb +0 -2
- data/lib/elasticity/strategies/alias_index.rb +5 -7
- data/lib/elasticity/strategies/single_index.rb +2 -4
- data/lib/elasticity/strategies.rb +0 -2
- data/lib/elasticity/version.rb +1 -3
- data/lib/elasticity.rb +1 -0
- metadata +25 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 199962dd3d7976f5fcefe948bed04e6c568d332c3ac6a9ecd1e5c89893a5f01a
|
4
|
+
data.tar.gz: e8a326cfa07858cb01a82ff47e735787fa517e36bebb1606d9c2965ce5b0966d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad6cd3a7af2e3f74f9f7f66670071400ae03576125f525a7c54c70a85a56507b7a8b2dce5bd7140a19c21c82e301ed64ee5b6e10421c703701b549a3a64c6647
|
7
|
+
data.tar.gz: 8a88dbdf4c9c0809e31c3aab5c6b1f315d47e21edc286540b30c1891371a0176fee5a6943c2a7e95f60c14da350a50a1d8ba272eaf70fcb34a122fac3a588aba
|
data/.circleci/config.yml
CHANGED
@@ -19,7 +19,7 @@ executors:
|
|
19
19
|
- image: cimg/ruby:2.7
|
20
20
|
environment:
|
21
21
|
BUNDLE_VERSION: '~> 2.3.4'
|
22
|
-
- image: docker.elastic.co/elasticsearch/elasticsearch:
|
22
|
+
- image: docker.elastic.co/elasticsearch/elasticsearch:8.6.2
|
23
23
|
environment:
|
24
24
|
- 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
|
25
25
|
- discovery.type=single-node
|
@@ -30,7 +30,7 @@ executors:
|
|
30
30
|
- image: cimg/ruby:3.0
|
31
31
|
environment:
|
32
32
|
BUNDLE_VERSION: '~> 2.3.4'
|
33
|
-
- image: docker.elastic.co/elasticsearch/elasticsearch:
|
33
|
+
- image: docker.elastic.co/elasticsearch/elasticsearch:8.6.2
|
34
34
|
environment:
|
35
35
|
- 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
|
36
36
|
- discovery.type=single-node
|
@@ -42,7 +42,7 @@ executors:
|
|
42
42
|
- image: cimg/ruby:3.1
|
43
43
|
environment:
|
44
44
|
BUNDLE_VERSION: '~> 2.3.4'
|
45
|
-
- image: docker.elastic.co/elasticsearch/elasticsearch:
|
45
|
+
- image: docker.elastic.co/elasticsearch/elasticsearch:8.6.2
|
46
46
|
environment:
|
47
47
|
- 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
|
48
48
|
- discovery.type=single-node
|
data/CHANGELOG.md
CHANGED
@@ -4,7 +4,13 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
-
## [
|
7
|
+
## [1.1.0] - 2023-05-02
|
8
|
+
### Changed
|
9
|
+
- Updated the max elasticsearch dependency version to < 8.7
|
10
|
+
|
11
|
+
## [1.0.1] - 2022-08-16
|
12
|
+
### Changed
|
13
|
+
- Revert the additional `frozen_string_literal` updates in 1.0.0 due to some issues with some classes. We'll update these in a separate release to isolate the problem.
|
8
14
|
|
9
15
|
## [1.0.0] - 2022-08-09
|
10
16
|
### Changed
|
data/Gemfile.lock
CHANGED
@@ -1,21 +1,22 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
es-elasticity (1.
|
4
|
+
es-elasticity (1.1.0)
|
5
5
|
activemodel (>= 5.2.0, < 7.1)
|
6
6
|
activerecord (>= 5.2.0, < 7.1)
|
7
7
|
activesupport (>= 5.2.0, < 7.1)
|
8
|
-
|
8
|
+
elastic-transport (>= 8.0, < 8.7)
|
9
|
+
elasticsearch (>= 7, < 8.7)
|
9
10
|
|
10
11
|
GEM
|
11
12
|
remote: https://artifacts.dox.support/repository/gems/
|
12
13
|
specs:
|
13
|
-
activemodel (7.0.3
|
14
|
-
activesupport (= 7.0.3
|
15
|
-
activerecord (7.0.3
|
16
|
-
activemodel (= 7.0.3
|
17
|
-
activesupport (= 7.0.3
|
18
|
-
activesupport (7.0.3
|
14
|
+
activemodel (7.0.4.3)
|
15
|
+
activesupport (= 7.0.4.3)
|
16
|
+
activerecord (7.0.4.3)
|
17
|
+
activemodel (= 7.0.4.3)
|
18
|
+
activesupport (= 7.0.4.3)
|
19
|
+
activesupport (7.0.4.3)
|
19
20
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
20
21
|
i18n (>= 1.6, < 2)
|
21
22
|
minitest (>= 5.1)
|
@@ -24,45 +25,25 @@ GEM
|
|
24
25
|
codeclimate-test-reporter (1.0.9)
|
25
26
|
simplecov (<= 0.13)
|
26
27
|
coderay (1.1.2)
|
27
|
-
concurrent-ruby (1.
|
28
|
+
concurrent-ruby (1.2.2)
|
28
29
|
diff-lcs (1.3)
|
29
|
-
|
30
|
-
|
31
|
-
elasticsearch-transport (= 7.17.1)
|
32
|
-
elasticsearch-api (7.17.1)
|
30
|
+
elastic-transport (8.2.1)
|
31
|
+
faraday (< 3)
|
33
32
|
multi_json
|
34
|
-
elasticsearch
|
35
|
-
|
33
|
+
elasticsearch (8.6.0)
|
34
|
+
elastic-transport (~> 8)
|
35
|
+
elasticsearch-api (= 8.6.0)
|
36
|
+
elasticsearch-api (8.6.0)
|
36
37
|
multi_json
|
37
|
-
faraday (
|
38
|
-
faraday-
|
39
|
-
faraday-em_synchrony (~> 1.0)
|
40
|
-
faraday-excon (~> 1.1)
|
41
|
-
faraday-httpclient (~> 1.0)
|
42
|
-
faraday-multipart (~> 1.0)
|
43
|
-
faraday-net_http (~> 1.0)
|
44
|
-
faraday-net_http_persistent (~> 1.0)
|
45
|
-
faraday-patron (~> 1.0)
|
46
|
-
faraday-rack (~> 1.0)
|
47
|
-
faraday-retry (~> 1.0)
|
38
|
+
faraday (2.7.4)
|
39
|
+
faraday-net_http (>= 2.0, < 3.1)
|
48
40
|
ruby2_keywords (>= 0.0.4)
|
49
|
-
faraday-
|
50
|
-
|
51
|
-
faraday-excon (1.1.0)
|
52
|
-
faraday-httpclient (1.0.1)
|
53
|
-
faraday-multipart (1.0.4)
|
54
|
-
multipart-post (~> 2)
|
55
|
-
faraday-net_http (1.0.1)
|
56
|
-
faraday-net_http_persistent (1.2.0)
|
57
|
-
faraday-patron (1.0.0)
|
58
|
-
faraday-rack (1.0.0)
|
59
|
-
faraday-retry (1.0.3)
|
60
|
-
i18n (1.12.0)
|
41
|
+
faraday-net_http (3.0.2)
|
42
|
+
i18n (1.13.0)
|
61
43
|
concurrent-ruby (~> 1.0)
|
62
44
|
method_source (0.9.2)
|
63
|
-
minitest (5.
|
45
|
+
minitest (5.18.0)
|
64
46
|
multi_json (1.15.0)
|
65
|
-
multipart-post (2.2.3)
|
66
47
|
oj (3.10.0)
|
67
48
|
pry (0.12.2)
|
68
49
|
coderay (~> 1.1.0)
|
@@ -89,7 +70,7 @@ GEM
|
|
89
70
|
simplecov-html (~> 0.7.1)
|
90
71
|
simplecov-html (0.7.1)
|
91
72
|
timecop (0.9.5)
|
92
|
-
tzinfo (2.0.
|
73
|
+
tzinfo (2.0.6)
|
93
74
|
concurrent-ruby (~> 1.0)
|
94
75
|
|
95
76
|
PLATFORMS
|
data/README.md
CHANGED
data/es-elasticity.gemspec
CHANGED
@@ -36,5 +36,6 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.add_dependency "activemodel", ">= 5.2.0", "< 7.1"
|
37
37
|
spec.add_dependency "activerecord", ">= 5.2.0", "< 7.1"
|
38
38
|
spec.add_dependency "activesupport", ">= 5.2.0", "< 7.1"
|
39
|
-
spec.add_dependency "elasticsearch", ">= 7", "< 8"
|
39
|
+
spec.add_dependency "elasticsearch", ">= 7", "< 8.7"
|
40
|
+
spec.add_dependency "elastic-transport", ">= 8.0", "< 8.7"
|
40
41
|
end
|
data/lib/elasticity/bulk.rb
CHANGED
data/lib/elasticity/config.rb
CHANGED
data/lib/elasticity/document.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
module Elasticity
|
4
2
|
class MultiSearchResponseParser
|
5
3
|
class UnknownError < StandardError; end
|
@@ -18,7 +16,7 @@ module Elasticity
|
|
18
16
|
private
|
19
17
|
|
20
18
|
def self.error_for(status)
|
21
|
-
|
19
|
+
Elastic::Transport::Transport::ERRORS[status] || UnknownError
|
22
20
|
end
|
23
21
|
end
|
24
22
|
end
|
data/lib/elasticity/railtie.rb
CHANGED
data/lib/elasticity/search.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
module Elasticity
|
4
2
|
module Strategies
|
5
3
|
# This strategy keeps two aliases that might be mapped to the same index or different index, allowing
|
@@ -110,7 +108,7 @@ module Elasticity
|
|
110
108
|
waiting_duration = 0
|
111
109
|
begin
|
112
110
|
@client.index_delete(index: original_index)
|
113
|
-
rescue
|
111
|
+
rescue Elastic::Transport::Transport::ServerError => e
|
114
112
|
if retryable_error?(e) && retry_delete_on_recoverable_errors && waiting_duration < max_delay
|
115
113
|
waiting_duration += retry_delay
|
116
114
|
sleep(retry_delay)
|
@@ -176,13 +174,13 @@ module Elasticity
|
|
176
174
|
|
177
175
|
def main_indexes
|
178
176
|
@client.index_get_alias(index: "#{@main_alias}-*", name: @main_alias).keys
|
179
|
-
rescue
|
177
|
+
rescue Elastic::Transport::Transport::Errors::NotFound
|
180
178
|
[]
|
181
179
|
end
|
182
180
|
|
183
181
|
def update_indexes
|
184
182
|
@client.index_get_alias(index: "#{@main_alias}-*", name: @update_alias).keys
|
185
|
-
rescue
|
183
|
+
rescue Elastic::Transport::Transport::Errors::NotFound
|
186
184
|
[]
|
187
185
|
end
|
188
186
|
|
@@ -266,7 +264,7 @@ module Elasticity
|
|
266
264
|
|
267
265
|
def settings
|
268
266
|
@client.index_get_settings(index: @main_alias).values.first
|
269
|
-
rescue
|
267
|
+
rescue Elastic::Transport::Transport::Errors::NotFound
|
270
268
|
nil
|
271
269
|
end
|
272
270
|
|
@@ -280,7 +278,7 @@ module Elasticity
|
|
280
278
|
|
281
279
|
def mapping
|
282
280
|
@client.index_get_mapping(index: @main_alias).values.first
|
283
|
-
rescue
|
281
|
+
rescue Elastic::Transport::Transport::Errors::NotFound
|
284
282
|
nil
|
285
283
|
end
|
286
284
|
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
module Elasticity
|
4
2
|
module Strategies
|
5
3
|
class SingleIndex
|
@@ -82,7 +80,7 @@ module Elasticity
|
|
82
80
|
|
83
81
|
def settings
|
84
82
|
@client.index_get_settings(index: @index_name).values.first
|
85
|
-
rescue
|
83
|
+
rescue Elastic::Transport::Transport::Errors::NotFound
|
86
84
|
nil
|
87
85
|
end
|
88
86
|
|
@@ -96,7 +94,7 @@ module Elasticity
|
|
96
94
|
|
97
95
|
def mapping
|
98
96
|
@client.index_get_mapping(index: @index_name).values.first
|
99
|
-
rescue
|
97
|
+
rescue Elastic::Transport::Transport::Errors::NotFound
|
100
98
|
nil
|
101
99
|
end
|
102
100
|
|
data/lib/elasticity/version.rb
CHANGED
data/lib/elasticity.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: es-elasticity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Kochenburger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -233,7 +233,7 @@ dependencies:
|
|
233
233
|
version: '7'
|
234
234
|
- - "<"
|
235
235
|
- !ruby/object:Gem::Version
|
236
|
-
version: '8'
|
236
|
+
version: '8.7'
|
237
237
|
type: :runtime
|
238
238
|
prerelease: false
|
239
239
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -243,7 +243,27 @@ dependencies:
|
|
243
243
|
version: '7'
|
244
244
|
- - "<"
|
245
245
|
- !ruby/object:Gem::Version
|
246
|
-
version: '8'
|
246
|
+
version: '8.7'
|
247
|
+
- !ruby/object:Gem::Dependency
|
248
|
+
name: elastic-transport
|
249
|
+
requirement: !ruby/object:Gem::Requirement
|
250
|
+
requirements:
|
251
|
+
- - ">="
|
252
|
+
- !ruby/object:Gem::Version
|
253
|
+
version: '8.0'
|
254
|
+
- - "<"
|
255
|
+
- !ruby/object:Gem::Version
|
256
|
+
version: '8.7'
|
257
|
+
type: :runtime
|
258
|
+
prerelease: false
|
259
|
+
version_requirements: !ruby/object:Gem::Requirement
|
260
|
+
requirements:
|
261
|
+
- - ">="
|
262
|
+
- !ruby/object:Gem::Version
|
263
|
+
version: '8.0'
|
264
|
+
- - "<"
|
265
|
+
- !ruby/object:Gem::Version
|
266
|
+
version: '8.7'
|
247
267
|
description: Elasticity provides a higher level abstraction on top of [elasticsearch-ruby](https://github.com/elasticsearch/elasticsearch-ruby)
|
248
268
|
gem
|
249
269
|
email:
|
@@ -304,7 +324,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
304
324
|
- !ruby/object:Gem::Version
|
305
325
|
version: '0'
|
306
326
|
requirements: []
|
307
|
-
rubygems_version: 3.
|
327
|
+
rubygems_version: 3.4.10
|
308
328
|
signing_key:
|
309
329
|
specification_version: 4
|
310
330
|
summary: ActiveModel-based library for working with Elasticsearch
|