es_dump_restore 0.0.11 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/es_dump_restore.gemspec +1 -0
- data/lib/es_dump_restore/es_client.rb +25 -2
- data/lib/es_dump_restore/version.rb +1 -1
- metadata +16 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86d387c4543740231133cf902eb7ef3ccc4b8032
|
4
|
+
data.tar.gz: f713de78847fab41c950625668dbfbfb3bc64241
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b4c08c8beac9653c832bd34b4fa544934f932eb1f7a06c124d6a824a9287e85f3efbe07b386e1880c2cff1ce47da57eecacf6f7595bf5789bacdf7ab9cc7fb5
|
7
|
+
data.tar.gz: 92889a08a395f142596394637b886fac7cd1baa7b23f09873ee69f70007f69fcaee5ba5743888a7d96d3bc2b9da5648fd45c538927ba88091de7a5069e309e0a
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
# Version 0.0.13 - April 10, 2015
|
2
|
+
|
3
|
+
* Fix a regression introduced for ES version 0.90.x by the previous release (thanks again Richard Boulton!)
|
4
|
+
|
5
|
+
# Version 0.0.12 - April 10, 2015 - YANKED
|
6
|
+
|
7
|
+
* Handle null values for settings and mappings; useful in the case of trying to dump an alias (thanks Richard Boulton!)
|
8
|
+
* Handle the case of ES losing the scroll context mid-dump (thanks again Richard Boulton!)
|
9
|
+
|
1
10
|
# Version 0.0.11 - March 4, 2015
|
2
11
|
|
3
12
|
* Make it possible to load on older versions of Ruby (thanks Alex Tomlins!)
|
data/es_dump_restore.gemspec
CHANGED
@@ -16,11 +16,29 @@ module EsDumpRestore
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def mappings
|
19
|
-
request(:get, "#{@path_prefix}/_mapping")
|
19
|
+
data = request(:get, "#{@path_prefix}/_mapping")
|
20
|
+
if data.values.size != 1
|
21
|
+
raise "Unexpected response: #{data}"
|
22
|
+
end
|
23
|
+
mappings = data.values.first
|
24
|
+
if mappings["mappings"].nil?
|
25
|
+
mappings
|
26
|
+
else
|
27
|
+
mappings["mappings"]
|
28
|
+
end
|
20
29
|
end
|
21
30
|
|
22
31
|
def settings
|
23
|
-
request(:get, "#{@path_prefix}/_settings")
|
32
|
+
data = request(:get, "#{@path_prefix}/_settings")
|
33
|
+
if data.values.size != 1
|
34
|
+
raise "Unexpected response: #{data}"
|
35
|
+
end
|
36
|
+
settings = data.values.first
|
37
|
+
if settings["settings"].nil?
|
38
|
+
settings
|
39
|
+
else
|
40
|
+
settings["settings"]
|
41
|
+
end
|
24
42
|
end
|
25
43
|
|
26
44
|
def start_scan(&block)
|
@@ -34,6 +52,7 @@ module EsDumpRestore
|
|
34
52
|
end
|
35
53
|
|
36
54
|
def each_scroll_hit(scroll_id, &block)
|
55
|
+
done = 0
|
37
56
|
loop do
|
38
57
|
batch = request(:get, '_search/scroll', {query: {
|
39
58
|
scroll: '10m', scroll_id: scroll_id
|
@@ -47,6 +66,10 @@ module EsDumpRestore
|
|
47
66
|
hits.each do |hit|
|
48
67
|
yield hit
|
49
68
|
end
|
69
|
+
|
70
|
+
total = batch_hits["total"]
|
71
|
+
done += hits.size
|
72
|
+
break if done >= total
|
50
73
|
end
|
51
74
|
end
|
52
75
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: es_dump_restore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nat Budin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
description: A utility for dumping the contents of an ElasticSearch index to a compressed
|
84
98
|
file and restoring the dumpfile back to an ElasticSearch server
|
85
99
|
email:
|
@@ -126,4 +140,3 @@ signing_key:
|
|
126
140
|
specification_version: 4
|
127
141
|
summary: Dump ElasticSearch indexes to files and restore them back
|
128
142
|
test_files: []
|
129
|
-
has_rdoc:
|