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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b2f48910ab846142b9a55a868ce832dbc4a8c1ec
4
- data.tar.gz: 3dd8c645093818313fd9f4fb5a974591bcd33516
3
+ metadata.gz: bf9d0a11b76b72579a70e136001f120d2e7b6ff6
4
+ data.tar.gz: af19933f50777d3200c75b53078399e86fa82cca
5
5
  SHA512:
6
- metadata.gz: 94812c6c1f76f535858d04a1fa91fafa86d65e57990d56adea77117a374b450e1d1d5267afa5d937e12490a318be32d9fee399f6758f9977fa3c8803acc9f9c0
7
- data.tar.gz: ec5999dafd6c14225eea303331db69ce85b19819e2fcda67df2f45ef78f95e7b7eaa73849c0a4fcb2e8c7bba819e731ec444f4f7c9e4b3797233bd07c144a79a
6
+ metadata.gz: 8c0f968a4fd443e7348ee39dd9dac33b4d7cffd51de59f8371b95227ccc0c8edeee54e22e9735bca1b6de6011d8fd9dbc1f65ee15e21eb39fa493efdd7f7acfa
7
+ data.tar.gz: 1a7979eea4e56f99a95b0b8b99a58755bcdfc16cef073e1633db3ccc6ed07512dc1096eb8dc77bc0cab21b79c6805f92c3ce88ae8838c65a2027affb63b86844
@@ -1,3 +1,6 @@
1
+ ## 2.1.1 (2016-01-02)
2
+ - Bulk index only rejects documents larger than the maximum request size
3
+
1
4
  ## 2.1.0 (2016-01-02)
2
5
  - Added enforcement of maximum request size
3
6
  - Added some exception wrapping
@@ -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 requst size or the client.max_request_size
419
+ # the configured client.max_request_size
420
420
  def check_action_size!( size )
421
- return unless (request_size && size > request_size) || (size > client.max_request_size)
422
- raise RequestSizeError, "Bulk action of size `#{size}` is too large"
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
@@ -1,5 +1,5 @@
1
1
  module Elastomer
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
3
3
 
4
4
  def self.version
5
5
  VERSION
@@ -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 allowed bulk request size" do
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 << @index.bulk(:request_size => 300) do |b|
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
- @index.refresh
246
- h = @index.docs.search :q => "*:*", :size => 0
248
+ index.refresh
249
+ h = index.docs.search :q => "*:*", :size => 0
247
250
 
248
251
  assert_equal 2, h["hits"]["total"]
249
252
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastomer-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Pease