embulk-output-elasticsearch_ruby 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be42f1b9b4d5953efa82af4f11eff2d1871e28d7
|
4
|
+
data.tar.gz: 994268d29c57b5f1145e1f4ac79922da18282c9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffd1752f6ae7f52fb1bc8a07d90ff59633f05799c31cf05f207f1607a31ab298aab48c031e7c1b6634dd9751c757a449b4ad94cce930f36195f0c22c415aaa52
|
7
|
+
data.tar.gz: 8ea0f41e0de01e06f3916b4b1c2377260097536d9f9b68abc31a8962655ef0b74ee750d4de1b11bcd601c8c38b3b25f062b9a66aff5409d4ea67debf99f53d2b
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
Gem::Specification.new do |spec|
|
3
3
|
spec.name = "embulk-output-elasticsearch_ruby"
|
4
|
-
spec.version = "0.1.
|
4
|
+
spec.version = "0.1.4"
|
5
5
|
spec.authors = ["toyama0919"]
|
6
6
|
spec.summary = "Elasticsearch Ruby output plugin for Embulk. Elasticsearch 1.X AND 2.X AND 5.X compatible."
|
7
7
|
spec.description = "Dumps records to Elasticsearch Ruby. Elasticsearch 1.X AND 2.X AND 5.X compatible."
|
@@ -17,6 +17,7 @@ module Embulk
|
|
17
17
|
"reload_connections" => config.param("reload_connections", :bool, default: true),
|
18
18
|
"reload_on_failure" => config.param("reload_on_failure", :bool, default: false),
|
19
19
|
"delete_old_index" => config.param("delete_old_index", :bool, default: false),
|
20
|
+
"delete_old_alias" => config.param("delete_old_alias", :bool, default: true),
|
20
21
|
"index_type" => config.param("index_type", :string),
|
21
22
|
"id_keys" => config.param("id_keys", :array, default: nil),
|
22
23
|
"id_format" => config.param("id_format", :string, default: nil),
|
@@ -89,8 +90,10 @@ module Embulk
|
|
89
90
|
indices = client.indices.get_alias(name: task['index']).keys
|
90
91
|
indices.each { |index|
|
91
92
|
if index != get_index(task)
|
92
|
-
|
93
|
-
|
93
|
+
if task['delete_old_alias']
|
94
|
+
client.indices.delete_alias index: index, name: task['index']
|
95
|
+
Embulk.logger.info "deleted alias: #{task['index']}, index: #{index}"
|
96
|
+
end
|
94
97
|
if task['delete_old_index']
|
95
98
|
client.indices.delete index: index
|
96
99
|
Embulk.logger.info "deleted index: #{index}"
|