elasticsearch-utils 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/elasticsearch/api/actions/stream.rb +7 -7
- data/lib/elasticsearch/utils/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02a43b21fdb6cb17ab9634fd0761a49e29d2c82b
|
4
|
+
data.tar.gz: 5c460754fefdd74fd9f7ac790fd759010cd93fb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a5cc68aab8c6a57f0bc02dd87fe3b9be745b418bc17e71b822c536996057913a7b92f8481dc7f7f11926b05d3f3492d49dc85c714ea76f942ce9577ec36e525
|
7
|
+
data.tar.gz: 4ccb0003355feeee0ce6bed79947744c815715356cac5d91ccd5c430f02cadd890be4f5ee5985a5a8f923f62e478a9f272072167ee3d6705b8c43723e483f47a
|
@@ -9,27 +9,27 @@ module Elasticsearch
|
|
9
9
|
def stream(*args, &block)
|
10
10
|
raise ArgumentError.new "wrong number of arguments (#{args.count} for 1..2)" if args.count > 2
|
11
11
|
raise ArgumentError.new 'no block given' unless block_given?
|
12
|
-
|
12
|
+
|
13
13
|
opts, memo = *args.reverse
|
14
14
|
opts[:scroll] = opts[:scroll] || opts['scroll'] || '5m'
|
15
|
-
|
15
|
+
|
16
16
|
scroll_opts = { :scroll => opts[:scroll] }
|
17
17
|
|
18
18
|
catch :stop_stream do
|
19
19
|
results = search opts
|
20
|
-
scroll_opts[:
|
21
|
-
|
20
|
+
scroll_opts[:body] = results['_scroll_id']
|
21
|
+
|
22
22
|
results = scroll scroll_opts if opts[:search_type] =~ /scan/
|
23
|
-
|
23
|
+
|
24
24
|
until results['hits']['hits'].empty? do
|
25
|
-
scroll_opts[:
|
25
|
+
scroll_opts[:body] = results['_scroll_id']
|
26
26
|
results['hits']['hits'].each do |doc|
|
27
27
|
memo = yield doc, memo
|
28
28
|
end
|
29
29
|
results = scroll scroll_opts
|
30
30
|
end
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
memo
|
34
34
|
end
|
35
35
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elasticsearch-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Hammond
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-07-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: elasticsearch
|
@@ -90,9 +90,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
version: '0'
|
91
91
|
requirements: []
|
92
92
|
rubyforge_project:
|
93
|
-
rubygems_version: 2.
|
93
|
+
rubygems_version: 2.4.8
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: Simple utilities built ontop of Elasticsearch
|
97
97
|
test_files: []
|
98
|
-
has_rdoc:
|