elasticsearch-utils 0.0.2 → 0.0.3

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: 5c30a6fdd193812730e128bd49baa1af8e5c2656
4
- data.tar.gz: 90039aa842757fc11070e2a8c422a5ed38a7a67a
3
+ metadata.gz: adee422b34a65d93deed013d4ee13b7221dc95b4
4
+ data.tar.gz: 1b253108977e9aefdbc5a8f88aca7d9205f707a3
5
5
  SHA512:
6
- metadata.gz: 16a28628ac345a33f208e972fd23a0c5296ebf893fad494057d4d089be923cb9469f81f6941500755c34c20c953b9d738e7ffcfd74f259181f171158c5c3dd11
7
- data.tar.gz: f034b7db2a3a12a90778a43a26cdbe768f298bb647ac62e8e1ebe24345d9db23f58fb964a72d0d21fbbb8a28353cf06e60ad7aa47de980018da2d68a81aeb9e6
6
+ metadata.gz: fe67b66467e29786812f21432cbcf7e609965d692b610524f18394abb94a1d057a56d6ad20b00aca1ad7aa22a626e5f1cb5bc2d057f56ad2c3039f21973a477f
7
+ data.tar.gz: 8b45755e03400469463119b733ccc3d9930e7eef6b0ba52802830e0f4735d1ca3d8010fab296446c0eacf61c0bae788140468592caad15ff51e2618219dcb308
data/README.md CHANGED
@@ -42,16 +42,16 @@ search_body = {
42
42
  search_params = index: :bobland, type: :person, body: search_body
43
43
 
44
44
  client.stream search_params do |doc|
45
- puts doc['name_last']
45
+ puts doc['_source']['name_last']
46
46
  end
47
47
  ```
48
48
 
49
- You can pass a `memo` variable to the block to track state in subsequent results. Stream will return the resulting memo.
49
+ You can pass a `memo` variable to the block to track state in subsequent results. The memo will become the return value of your block and will be passed to the next iteration.
50
50
 
51
51
  ```
52
52
  bob_families = SortedSet.new
53
53
  bob_families = client.stream search_params do |doc, bob_families|
54
- bob_families << doc['name_last']
54
+ bob_families << doc['_source']['name_last']
55
55
  end
56
56
 
57
57
  puts "There are #{bob_families.count} families of bobs!"
@@ -24,8 +24,7 @@ module Elasticsearch
24
24
  until results['hits']['hits'].empty? do
25
25
  scroll_opts[:scroll_id] = results['_scroll_id']
26
26
  results['hits']['hits'].each do |doc|
27
- doc_source = doc['_source']
28
- memo = yield doc_source, memo
27
+ memo = yield doc, memo
29
28
  end
30
29
  results = scroll scroll_opts
31
30
  end
@@ -1,5 +1,5 @@
1
1
  module Elasticsearch
2
2
  module Utils
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
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.2
4
+ version: 0.0.3
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-20 00:00:00.000000000 Z
12
+ date: 2014-08-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: elasticsearch
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  version: '0'
91
91
  requirements: []
92
92
  rubyforge_project:
93
- rubygems_version: 2.2.2
93
+ rubygems_version: 2.2.0
94
94
  signing_key:
95
95
  specification_version: 4
96
96
  summary: Simple utilities built ontop of Elasticsearch