stretcher 1.20.0 → 1.20.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stretcher/index.rb +8 -2
- data/lib/stretcher/version.rb +1 -1
- data/stretcher.gemspec +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1593e9afaf2d5dd9f6e07b92ba1db3cabd413861
|
4
|
+
data.tar.gz: b5d3512303309e836a03e2cff591a8e18e3b1b80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea4270733fe0d805920f9b68787d4d6532009dc4efe98c1af31d90ba30df3736981ba56712d1d0bbed9c95eca99b3c82128b0a4f9cf66cffff3554da93afa655
|
7
|
+
data.tar.gz: 659c8f763d062e50765be9d93fb74908cd19913dac9c95fb9d2f78c1c185a75208bca30d8170e6222fa36752d687e5c17c54e93df134b63aeb83be3b269e564a
|
data/lib/stretcher/index.rb
CHANGED
@@ -54,7 +54,7 @@ module Stretcher
|
|
54
54
|
|
55
55
|
body = documents.reduce("") {|post_data, d_raw|
|
56
56
|
d = Hashie::Mash.new(d_raw)
|
57
|
-
index_meta = { :
|
57
|
+
index_meta = { :_id => (d[:id] || d.delete(:_id)) }
|
58
58
|
|
59
59
|
system_fields = %w{_type _parent _routing}
|
60
60
|
d.keys.reduce(index_meta) do |memo, key|
|
@@ -65,7 +65,7 @@ module Stretcher
|
|
65
65
|
post_data << (MultiJson.dump(d) << "\n") unless action == :delete
|
66
66
|
post_data
|
67
67
|
}
|
68
|
-
|
68
|
+
bulk body, options
|
69
69
|
end
|
70
70
|
|
71
71
|
# Creates the index, with the supplied hash as the options body (usually mappings: and settings:))
|
@@ -186,6 +186,12 @@ module Stretcher
|
|
186
186
|
def delete_percolator_query(query_name)
|
187
187
|
server.request(:delete, percolator_query_path(query_name))
|
188
188
|
end
|
189
|
+
|
190
|
+
# Perform a raw bulk operation. You probably want to use Stretcher::Index#bulk_index
|
191
|
+
# which properly formats a bulk index request.
|
192
|
+
def bulk(data, options={})
|
193
|
+
request(:post, "_bulk", options, data)
|
194
|
+
end
|
189
195
|
|
190
196
|
# Full path to this index
|
191
197
|
def path_uri(path="/")
|
data/lib/stretcher/version.rb
CHANGED
data/stretcher.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stretcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.20.
|
4
|
+
version: 1.20.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Cholakian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|