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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: adee422b34a65d93deed013d4ee13b7221dc95b4
4
- data.tar.gz: 1b253108977e9aefdbc5a8f88aca7d9205f707a3
3
+ metadata.gz: 02a43b21fdb6cb17ab9634fd0761a49e29d2c82b
4
+ data.tar.gz: 5c460754fefdd74fd9f7ac790fd759010cd93fb2
5
5
  SHA512:
6
- metadata.gz: fe67b66467e29786812f21432cbcf7e609965d692b610524f18394abb94a1d057a56d6ad20b00aca1ad7aa22a626e5f1cb5bc2d057f56ad2c3039f21973a477f
7
- data.tar.gz: 8b45755e03400469463119b733ccc3d9930e7eef6b0ba52802830e0f4735d1ca3d8010fab296446c0eacf61c0bae788140468592caad15ff51e2618219dcb308
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[:scroll_id] = results['_scroll_id']
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[:scroll_id] = results['_scroll_id']
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
@@ -1,5 +1,5 @@
1
1
  module Elasticsearch
2
2
  module Utils
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  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.3
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: 2014-08-25 00:00:00.000000000 Z
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.2.0
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: