zelastic 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +1 -1
- data/.github/dependabot.yml +9 -0
- data/Gemfile.lock +74 -58
- data/lib/zelastic/indexer.rb +8 -8
- data/lib/zelastic/version.rb +1 -1
- data/zelastic.gemspec +1 -1
- metadata +12 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2f54a69201807f3ba79aa72f7ea5b51c1adfebcdc06d4b51f4662f49c96bc0c7
|
|
4
|
+
data.tar.gz: '0480ef88c0c3f3f170c18712d2e9208b4fbcd0f7614abbb9cb9b89d2636443be'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4ba1d3c04f92728c3a414a3b09551117c664eeb3e1ec9e4f395bb393b33cc8de55bb4239da17fd98be0a8171f3ae038a769f3a2b93147abf42fcac8a13ab0254
|
|
7
|
+
data.tar.gz: 954fe26c4ed02e57e00ae29c82f26b1eba33f6c637e520db7610a220a851b9d158f4052a9323c506804247b8f527115ce808401cb42c1a893ab93d64f9025a34
|
data/.circleci/config.yml
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,78 +1,94 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
zelastic (0.6.
|
|
4
|
+
zelastic (0.6.2)
|
|
5
5
|
activesupport
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
activemodel (
|
|
11
|
-
activesupport (=
|
|
12
|
-
activerecord (
|
|
13
|
-
activemodel (=
|
|
14
|
-
activesupport (=
|
|
15
|
-
|
|
16
|
-
activesupport (5.1.4)
|
|
10
|
+
activemodel (6.1.3)
|
|
11
|
+
activesupport (= 6.1.3)
|
|
12
|
+
activerecord (6.1.3)
|
|
13
|
+
activemodel (= 6.1.3)
|
|
14
|
+
activesupport (= 6.1.3)
|
|
15
|
+
activesupport (6.1.3)
|
|
17
16
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
18
|
-
i18n (
|
|
19
|
-
minitest (
|
|
20
|
-
tzinfo (~>
|
|
21
|
-
|
|
22
|
-
ast (2.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
i18n (>= 1.6, < 2)
|
|
18
|
+
minitest (>= 5.1)
|
|
19
|
+
tzinfo (~> 2.0)
|
|
20
|
+
zeitwerk (~> 2.3)
|
|
21
|
+
ast (2.4.1)
|
|
22
|
+
carwow_rubocop (3.3.0)
|
|
23
|
+
rubocop (>= 0.78)
|
|
24
|
+
rubocop-performance
|
|
25
|
+
rubocop-rspec
|
|
26
|
+
coderay (1.1.3)
|
|
27
|
+
concurrent-ruby (1.1.8)
|
|
28
|
+
diff-lcs (1.4.4)
|
|
29
|
+
elasticsearch (7.11.2)
|
|
30
|
+
elasticsearch-api (= 7.11.2)
|
|
31
|
+
elasticsearch-transport (= 7.11.2)
|
|
32
|
+
elasticsearch-api (7.11.2)
|
|
30
33
|
multi_json
|
|
31
|
-
elasticsearch-transport (
|
|
32
|
-
faraday
|
|
34
|
+
elasticsearch-transport (7.11.2)
|
|
35
|
+
faraday (~> 1)
|
|
33
36
|
multi_json
|
|
34
|
-
faraday (
|
|
37
|
+
faraday (1.3.0)
|
|
38
|
+
faraday-net_http (~> 1.0)
|
|
35
39
|
multipart-post (>= 1.2, < 3)
|
|
36
|
-
|
|
40
|
+
ruby2_keywords
|
|
41
|
+
faraday-net_http (1.0.1)
|
|
42
|
+
i18n (1.8.9)
|
|
37
43
|
concurrent-ruby (~> 1.0)
|
|
38
|
-
method_source (0.
|
|
39
|
-
minitest (5.
|
|
40
|
-
multi_json (1.
|
|
41
|
-
multipart-post (2.
|
|
42
|
-
parallel (1.
|
|
43
|
-
parser (2.
|
|
44
|
-
ast (~> 2.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
method_source (~> 0.9.0)
|
|
44
|
+
method_source (1.0.0)
|
|
45
|
+
minitest (5.14.3)
|
|
46
|
+
multi_json (1.15.0)
|
|
47
|
+
multipart-post (2.1.1)
|
|
48
|
+
parallel (1.19.1)
|
|
49
|
+
parser (2.7.1.3)
|
|
50
|
+
ast (~> 2.4.0)
|
|
51
|
+
pry (0.14.0)
|
|
52
|
+
coderay (~> 1.1)
|
|
53
|
+
method_source (~> 1.0)
|
|
49
54
|
rainbow (3.0.0)
|
|
50
|
-
rake (13.0.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
rspec-
|
|
55
|
-
|
|
56
|
-
rspec-
|
|
57
|
-
rspec-
|
|
55
|
+
rake (13.0.3)
|
|
56
|
+
regexp_parser (1.7.1)
|
|
57
|
+
rexml (3.2.4)
|
|
58
|
+
rspec (3.10.0)
|
|
59
|
+
rspec-core (~> 3.10.0)
|
|
60
|
+
rspec-expectations (~> 3.10.0)
|
|
61
|
+
rspec-mocks (~> 3.10.0)
|
|
62
|
+
rspec-core (3.10.0)
|
|
63
|
+
rspec-support (~> 3.10.0)
|
|
64
|
+
rspec-expectations (3.10.0)
|
|
58
65
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
59
|
-
rspec-support (~> 3.
|
|
60
|
-
rspec-mocks (3.
|
|
66
|
+
rspec-support (~> 3.10.0)
|
|
67
|
+
rspec-mocks (3.10.0)
|
|
61
68
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
62
|
-
rspec-support (~> 3.
|
|
63
|
-
rspec-support (3.
|
|
64
|
-
rubocop (0.
|
|
69
|
+
rspec-support (~> 3.10.0)
|
|
70
|
+
rspec-support (3.10.0)
|
|
71
|
+
rubocop (0.85.1)
|
|
65
72
|
parallel (~> 1.10)
|
|
66
|
-
parser (>= 2.
|
|
67
|
-
powerpack (~> 0.1)
|
|
73
|
+
parser (>= 2.7.0.1)
|
|
68
74
|
rainbow (>= 2.2.2, < 4.0)
|
|
75
|
+
regexp_parser (>= 1.7)
|
|
76
|
+
rexml
|
|
77
|
+
rubocop-ast (>= 0.0.3)
|
|
69
78
|
ruby-progressbar (~> 1.7)
|
|
70
|
-
unicode-display_width (
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
79
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
|
80
|
+
rubocop-ast (0.0.3)
|
|
81
|
+
parser (>= 2.7.0.1)
|
|
82
|
+
rubocop-performance (1.6.1)
|
|
83
|
+
rubocop (>= 0.71.0)
|
|
84
|
+
rubocop-rspec (1.40.0)
|
|
85
|
+
rubocop (>= 0.68.1)
|
|
86
|
+
ruby-progressbar (1.10.1)
|
|
87
|
+
ruby2_keywords (0.0.4)
|
|
88
|
+
tzinfo (2.0.4)
|
|
89
|
+
concurrent-ruby (~> 1.0)
|
|
90
|
+
unicode-display_width (1.7.0)
|
|
91
|
+
zeitwerk (2.4.2)
|
|
76
92
|
|
|
77
93
|
PLATFORMS
|
|
78
94
|
ruby
|
|
@@ -80,12 +96,12 @@ PLATFORMS
|
|
|
80
96
|
DEPENDENCIES
|
|
81
97
|
activerecord
|
|
82
98
|
bundler
|
|
99
|
+
carwow_rubocop
|
|
83
100
|
elasticsearch
|
|
84
101
|
pry
|
|
85
102
|
rake
|
|
86
103
|
rspec
|
|
87
|
-
rubocop
|
|
88
104
|
zelastic!
|
|
89
105
|
|
|
90
106
|
BUNDLED WITH
|
|
91
|
-
1.
|
|
107
|
+
2.1.4
|
data/lib/zelastic/indexer.rb
CHANGED
|
@@ -17,19 +17,19 @@ module Zelastic
|
|
|
17
17
|
@config = config
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
def index_batch(batch, client: nil, index_name: nil)
|
|
20
|
+
def index_batch(batch, client: nil, index_name: nil, refresh: false)
|
|
21
21
|
version = current_version
|
|
22
|
-
execute_bulk(client: client, index_name: index_name) do |index|
|
|
22
|
+
execute_bulk(client: client, index_name: index_name, refresh: refresh) do |index|
|
|
23
23
|
batch.map do |record|
|
|
24
24
|
index_command(index: index, version: version, record: record)
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
def index_record(record)
|
|
29
|
+
def index_record(record, refresh: false)
|
|
30
30
|
version = current_version
|
|
31
31
|
|
|
32
|
-
execute_bulk do |index_name|
|
|
32
|
+
execute_bulk(refresh: refresh) do |index_name|
|
|
33
33
|
[index_command(index: index_name, version: version, record: record)]
|
|
34
34
|
end
|
|
35
35
|
end
|
|
@@ -91,7 +91,7 @@ module Zelastic
|
|
|
91
91
|
}
|
|
92
92
|
end
|
|
93
93
|
|
|
94
|
-
def execute_bulk(client: nil, index_name: nil)
|
|
94
|
+
def execute_bulk(client: nil, index_name: nil, refresh: false)
|
|
95
95
|
clients = Array(client || config.clients)
|
|
96
96
|
|
|
97
97
|
clients.map do |current_client|
|
|
@@ -99,7 +99,7 @@ module Zelastic
|
|
|
99
99
|
|
|
100
100
|
commands = indices.flat_map { |index| yield(index) }
|
|
101
101
|
|
|
102
|
-
current_client.bulk(body: commands).tap do |result|
|
|
102
|
+
current_client.bulk(body: commands, refresh: refresh).tap do |result|
|
|
103
103
|
check_errors!(result)
|
|
104
104
|
end
|
|
105
105
|
end
|
|
@@ -123,14 +123,14 @@ module Zelastic
|
|
|
123
123
|
end
|
|
124
124
|
|
|
125
125
|
def ignorable_error?(error)
|
|
126
|
-
# rubocop:disable
|
|
126
|
+
# rubocop:disable Layout/LineLength
|
|
127
127
|
regexp =
|
|
128
128
|
if config.type?
|
|
129
129
|
/^\[#{config.type}\]\[\d+\]: version conflict, current version \[\d+\] is higher or equal to the one provided \[\d+\]$/
|
|
130
130
|
else
|
|
131
131
|
/^\[\d+\]: version conflict, current version \[\d+\] is higher or equal to the one provided \[\d+\]$/
|
|
132
132
|
end
|
|
133
|
-
# rubocop:enable
|
|
133
|
+
# rubocop:enable Layout/LineLength
|
|
134
134
|
error['type'] == 'version_conflict_engine_exception' &&
|
|
135
135
|
error['reason'] =~ regexp
|
|
136
136
|
end
|
data/lib/zelastic/version.rb
CHANGED
data/zelastic.gemspec
CHANGED
|
@@ -26,9 +26,9 @@ Gem::Specification.new do |spec|
|
|
|
26
26
|
|
|
27
27
|
spec.add_development_dependency 'activerecord'
|
|
28
28
|
spec.add_development_dependency 'bundler'
|
|
29
|
+
spec.add_development_dependency 'carwow_rubocop'
|
|
29
30
|
spec.add_development_dependency 'elasticsearch'
|
|
30
31
|
spec.add_development_dependency 'pry'
|
|
31
32
|
spec.add_development_dependency 'rake'
|
|
32
33
|
spec.add_development_dependency 'rspec'
|
|
33
|
-
spec.add_development_dependency 'rubocop'
|
|
34
34
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zelastic
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- carwow Developers
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-03-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -53,7 +53,7 @@ dependencies:
|
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '0'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
|
-
name:
|
|
56
|
+
name: carwow_rubocop
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
59
|
- - ">="
|
|
@@ -67,7 +67,7 @@ dependencies:
|
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '0'
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
|
-
name:
|
|
70
|
+
name: elasticsearch
|
|
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:
|
|
84
|
+
name: pry
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
|
86
86
|
requirements:
|
|
87
87
|
- - ">="
|
|
@@ -95,7 +95,7 @@ dependencies:
|
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: '0'
|
|
97
97
|
- !ruby/object:Gem::Dependency
|
|
98
|
-
name:
|
|
98
|
+
name: rake
|
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
|
100
100
|
requirements:
|
|
101
101
|
- - ">="
|
|
@@ -109,7 +109,7 @@ dependencies:
|
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
110
|
version: '0'
|
|
111
111
|
- !ruby/object:Gem::Dependency
|
|
112
|
-
name:
|
|
112
|
+
name: rspec
|
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
|
114
114
|
requirements:
|
|
115
115
|
- - ">="
|
|
@@ -130,6 +130,7 @@ extensions: []
|
|
|
130
130
|
extra_rdoc_files: []
|
|
131
131
|
files:
|
|
132
132
|
- ".circleci/config.yml"
|
|
133
|
+
- ".github/dependabot.yml"
|
|
133
134
|
- ".gitignore"
|
|
134
135
|
- ".rspec"
|
|
135
136
|
- ".rubocop.yml"
|
|
@@ -152,7 +153,7 @@ homepage: https://github.com/carwow/zelastic
|
|
|
152
153
|
licenses:
|
|
153
154
|
- MIT
|
|
154
155
|
metadata: {}
|
|
155
|
-
post_install_message:
|
|
156
|
+
post_install_message:
|
|
156
157
|
rdoc_options: []
|
|
157
158
|
require_paths:
|
|
158
159
|
- lib
|
|
@@ -167,8 +168,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
167
168
|
- !ruby/object:Gem::Version
|
|
168
169
|
version: '0'
|
|
169
170
|
requirements: []
|
|
170
|
-
rubygems_version: 3.
|
|
171
|
-
signing_key:
|
|
171
|
+
rubygems_version: 3.1.4
|
|
172
|
+
signing_key:
|
|
172
173
|
specification_version: 4
|
|
173
174
|
summary: Zero-downtime (re-)indexing of ActiveRecord models into Elasticsearch.
|
|
174
175
|
test_files: []
|