scalastic 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/scalastic/normalizer.rb +7 -1
- data/lib/scalastic/scroller.rb +4 -4
- data/lib/scalastic/version.rb +1 -1
- metadata +49 -49
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee62608cd0f7a9e28cf377d8ccc9b46dca5bbb6e
|
4
|
+
data.tar.gz: 9e57722efd8725a62eea09ca68f746e7173c9fe7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82d1cc08d8f7e4349956f60acdef9b3541db0a3e3efbada1bff9609495e55a5fcd788d83970346bd811e955809a6e06e90ba344ee2f7ca1c5a4596274075e63e
|
7
|
+
data.tar.gz: 1e348dcebe37380687a7522297831c6f0c622a4566e6ea1b34789a31a31f82bb9435da9eb62e1d893d612b466331eec5dba6dc21886573a8241c237093685d01
|
data/lib/scalastic/normalizer.rb
CHANGED
@@ -7,11 +7,17 @@ module Scalastic
|
|
7
7
|
normalize_internal(hash)
|
8
8
|
end
|
9
9
|
|
10
|
+
def safe_get(hash, *keys)
|
11
|
+
keys.reduce(hash) do |h, k|
|
12
|
+
h && (h[k.to_s] || h[k.to_sym])
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
10
16
|
private
|
11
17
|
|
12
18
|
def normalize_internal(object)
|
13
19
|
if (object.is_a?(Hash))
|
14
|
-
object.map{|k, v| [k.to_s, normalize_internal(v)]}
|
20
|
+
Hash[object.map{|k, v| [k.to_s, normalize_internal(v)]}]
|
15
21
|
elsif object.respond_to?(:map)
|
16
22
|
object.map{|i| normalize_internal(i)}
|
17
23
|
else
|
data/lib/scalastic/scroller.rb
CHANGED
@@ -21,11 +21,11 @@ module Scalastic
|
|
21
21
|
def each(&block)
|
22
22
|
Enumerator.new do |enum|
|
23
23
|
args = @args.merge(search_type: 'scan', scroll: scroll)
|
24
|
-
res =
|
24
|
+
res = @es_client.search(args)
|
25
25
|
loop do
|
26
|
-
scroll_id = res
|
27
|
-
res =
|
28
|
-
hits = res
|
26
|
+
scroll_id = safe_get(res, '_scroll_id')
|
27
|
+
res = @es_client.scroll(body: scroll_id, scroll: scroll)
|
28
|
+
hits = safe_get(res, 'hits', 'hits')
|
29
29
|
break unless hits.any?
|
30
30
|
hits.each{|h| enum << h}
|
31
31
|
end
|
data/lib/scalastic/version.rb
CHANGED
metadata
CHANGED
@@ -1,105 +1,105 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scalastic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aliaksei Baturytski
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
|
-
|
15
|
+
version_requirements: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.10'
|
20
|
-
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirement: !ruby/object:Gem::Requirement
|
23
21
|
requirements:
|
24
|
-
- -
|
22
|
+
- - ~>
|
25
23
|
- !ruby/object:Gem::Version
|
26
24
|
version: '1.10'
|
25
|
+
prerelease: false
|
26
|
+
type: :development
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
|
-
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
|
-
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
37
35
|
requirements:
|
38
|
-
- -
|
36
|
+
- - ~>
|
39
37
|
- !ruby/object:Gem::Version
|
40
38
|
version: '10.0'
|
39
|
+
prerelease: false
|
40
|
+
type: :development
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
|
-
|
43
|
+
version_requirements: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '3.4'
|
48
|
-
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
51
49
|
requirements:
|
52
|
-
- -
|
50
|
+
- - ~>
|
53
51
|
- !ruby/object:Gem::Version
|
54
52
|
version: '3.4'
|
53
|
+
prerelease: false
|
54
|
+
type: :development
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: simplecov
|
57
|
-
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0.11'
|
62
|
-
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
62
|
+
requirement: !ruby/object:Gem::Requirement
|
65
63
|
requirements:
|
66
|
-
- -
|
64
|
+
- - ~>
|
67
65
|
- !ruby/object:Gem::Version
|
68
66
|
version: '0.11'
|
67
|
+
prerelease: false
|
68
|
+
type: :development
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: json
|
71
|
-
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '1.8'
|
76
|
-
- -
|
76
|
+
- - '>='
|
77
77
|
- !ruby/object:Gem::Version
|
78
78
|
version: 1.8.3
|
79
|
-
|
80
|
-
prerelease: false
|
81
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirement: !ruby/object:Gem::Requirement
|
82
80
|
requirements:
|
83
|
-
- -
|
81
|
+
- - ~>
|
84
82
|
- !ruby/object:Gem::Version
|
85
83
|
version: '1.8'
|
86
|
-
- -
|
84
|
+
- - '>='
|
87
85
|
- !ruby/object:Gem::Version
|
88
86
|
version: 1.8.3
|
87
|
+
prerelease: false
|
88
|
+
type: :runtime
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: elasticsearch
|
91
|
-
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
|
-
- -
|
93
|
+
- - ~>
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '1.0'
|
96
|
-
|
97
|
-
prerelease: false
|
98
|
-
version_requirements: !ruby/object:Gem::Requirement
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
99
97
|
requirements:
|
100
|
-
- -
|
98
|
+
- - ~>
|
101
99
|
- !ruby/object:Gem::Version
|
102
100
|
version: '1.0'
|
101
|
+
prerelease: false
|
102
|
+
type: :runtime
|
103
103
|
description: Elasticsearch alias-based partitions for scalable indexing and searching
|
104
104
|
email:
|
105
105
|
- abaturytski@gmail.com
|
@@ -107,8 +107,8 @@ executables: []
|
|
107
107
|
extensions: []
|
108
108
|
extra_rdoc_files: []
|
109
109
|
files:
|
110
|
-
-
|
111
|
-
-
|
110
|
+
- .gitignore
|
111
|
+
- .travis.yml
|
112
112
|
- Gemfile
|
113
113
|
- LICENSE.txt
|
114
114
|
- README.md
|
@@ -149,24 +149,24 @@ homepage: https://github.com/aliakb/scalastic
|
|
149
149
|
licenses:
|
150
150
|
- MIT
|
151
151
|
metadata: {}
|
152
|
-
post_install_message:
|
152
|
+
post_install_message:
|
153
153
|
rdoc_options: []
|
154
154
|
require_paths:
|
155
155
|
- lib
|
156
156
|
required_ruby_version: !ruby/object:Gem::Requirement
|
157
157
|
requirements:
|
158
|
-
- -
|
158
|
+
- - '>='
|
159
159
|
- !ruby/object:Gem::Version
|
160
160
|
version: '1.9'
|
161
161
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
162
|
requirements:
|
163
|
-
- -
|
163
|
+
- - '>='
|
164
164
|
- !ruby/object:Gem::Version
|
165
165
|
version: '0'
|
166
166
|
requirements: []
|
167
|
-
rubyforge_project:
|
168
|
-
rubygems_version: 2.5
|
169
|
-
signing_key:
|
167
|
+
rubyforge_project:
|
168
|
+
rubygems_version: 2.4.5
|
169
|
+
signing_key:
|
170
170
|
specification_version: 4
|
171
171
|
summary: Elasticsearch document partitions
|
172
172
|
test_files: []
|