elastomer-client 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/elastomer/client/bulk.rb +3 -3
- data/lib/elastomer/version.rb +1 -1
- data/test/client/bulk_test.rb +7 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf9d0a11b76b72579a70e136001f120d2e7b6ff6
|
4
|
+
data.tar.gz: af19933f50777d3200c75b53078399e86fa82cca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c0f968a4fd443e7348ee39dd9dac33b4d7cffd51de59f8371b95227ccc0c8edeee54e22e9735bca1b6de6011d8fd9dbc1f65ee15e21eb39fa493efdd7f7acfa
|
7
|
+
data.tar.gz: 1a7979eea4e56f99a95b0b8b99a58755bcdfc16cef073e1633db3ccc6ed07512dc1096eb8dc77bc0cab21b79c6805f92c3ce88ae8838c65a2027affb63b86844
|
data/CHANGELOG.md
CHANGED
@@ -416,10 +416,10 @@ module Elastomer
|
|
416
416
|
end
|
417
417
|
|
418
418
|
# Internal: Raises a RequestSizeError if the given size is larger than
|
419
|
-
# the configured
|
419
|
+
# the configured client.max_request_size
|
420
420
|
def check_action_size!( size )
|
421
|
-
return unless
|
422
|
-
raise RequestSizeError, "Bulk action of size `#{size}`
|
421
|
+
return unless size > client.max_request_size
|
422
|
+
raise RequestSizeError, "Bulk action of size `#{size}` exceeds the maximum requst size: #{client.max_request_size}"
|
423
423
|
end
|
424
424
|
|
425
425
|
end
|
data/lib/elastomer/version.rb
CHANGED
data/test/client/bulk_test.rb
CHANGED
@@ -224,9 +224,12 @@ describe Elastomer::Client::Bulk do
|
|
224
224
|
assert_equal 10, h["hits"]["total"]
|
225
225
|
end
|
226
226
|
|
227
|
-
it "rejects documents that excceed the
|
227
|
+
it "rejects documents that excceed the maximum request size" do
|
228
|
+
client = Elastomer::Client.new($client_params.merge(:max_request_size => 300))
|
229
|
+
index = client.index(@name)
|
230
|
+
|
228
231
|
ary = []
|
229
|
-
ary <<
|
232
|
+
ary << index.bulk(:request_size => 300) do |b|
|
230
233
|
2.times { |num|
|
231
234
|
document = {:_id => num, :_type => "tweet", :author => "pea53", :message => "tweet #{num} is a 100 character request"}
|
232
235
|
ary << b.index(document)
|
@@ -242,8 +245,8 @@ describe Elastomer::Client::Bulk do
|
|
242
245
|
assert_equal 1, ary.length
|
243
246
|
ary.each { |a| a["items"].each { |b| assert_bulk_index(b) } }
|
244
247
|
|
245
|
-
|
246
|
-
h =
|
248
|
+
index.refresh
|
249
|
+
h = index.docs.search :q => "*:*", :size => 0
|
247
250
|
|
248
251
|
assert_equal 2, h["hits"]["total"]
|
249
252
|
end
|