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 +4 -4
- data/README.md +3 -3
- data/lib/elasticsearch/api/actions/stream.rb +1 -2
- data/lib/elasticsearch/utils/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adee422b34a65d93deed013d4ee13b7221dc95b4
|
4
|
+
data.tar.gz: 1b253108977e9aefdbc5a8f88aca7d9205f707a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
-
|
28
|
-
memo = yield doc_source, memo
|
27
|
+
memo = yield doc, memo
|
29
28
|
end
|
30
29
|
results = scroll scroll_opts
|
31
30
|
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.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-
|
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.
|
93
|
+
rubygems_version: 2.2.0
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
96
|
summary: Simple utilities built ontop of Elasticsearch
|