es 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/es/raw_client.rb +2 -2
- data/lib/es/version.rb +1 -1
- data/spec/es/raw_client_spec.rb +2 -2
- metadata +1 -1
data/lib/es/raw_client.rb
CHANGED
@@ -32,13 +32,13 @@ module ES
|
|
32
32
|
@connection.request(:post, action_path(path, :update), data)
|
33
33
|
end
|
34
34
|
|
35
|
-
def bulk(
|
35
|
+
def bulk(requests, path = nil)
|
36
36
|
@connection.request(:post, action_path(path, :bulk), requests)
|
37
37
|
end
|
38
38
|
|
39
39
|
private
|
40
40
|
def action_path(path, action)
|
41
|
-
"#{path}/_#{action}"
|
41
|
+
path ? "#{path}/_#{action}" : "_#{action}"
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
data/lib/es/version.rb
CHANGED
data/spec/es/raw_client_spec.rb
CHANGED
@@ -48,9 +48,9 @@ describe ES::RawClient do
|
|
48
48
|
|
49
49
|
context '.bulk' do
|
50
50
|
it 'sends POST to connection' do
|
51
|
-
connection.should_receive(:request).with(:post, '
|
51
|
+
connection.should_receive(:request).with(:post, '_bulk', data).and_return(response)
|
52
52
|
|
53
|
-
subject.bulk(
|
53
|
+
subject.bulk(data).should == response
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|