From becf099dc924bd4ee3b6b4bb7f5cefc5a2a584c6 Mon Sep 17 00:00:00 2001 From: Daniel Nill Date: Wed, 7 Jun 2017 13:24:13 -0700 Subject: [PATCH] fix bug in remap to use scan api properly (#45) Because of a bug in elasticsearch ruby gem the scan id must be passed directly in the body. https://github.com/elastic/elasticsearch-ruby/issues/423 --- CHANGELOG | 2 ++ lib/elasticity/strategies/alias_index.rb | 2 +- lib/elasticity/version.rb | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 11ebfb9..f09e74f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +v0.8.3 + - fix remap method to use the scan api properly. v0.8.2 - fix scan api to work with more recent versions of elasticsearch ruby. v0.8.1 diff --git a/lib/elasticity/strategies/alias_index.rb b/lib/elasticity/strategies/alias_index.rb index 1f8d563..c62b033 100644 --- a/lib/elasticity/strategies/alias_index.rb +++ b/lib/elasticity/strategies/alias_index.rb @@ -83,7 +83,7 @@ def remap(index_def) end @client.bulk(body: ops) unless ops.empty? - cursor = @client.scroll(scroll_id: cursor['_scroll_id'], scroll: '1m') + cursor = @client.scroll(scroll_id: cursor['_scroll_id'], scroll: '1m', body: { scroll_id: cursor["_scroll_id"] }) end # Update aliases to only point to the new index. diff --git a/lib/elasticity/version.rb b/lib/elasticity/version.rb index 7aa85b6..954110d 100644 --- a/lib/elasticity/version.rb +++ b/lib/elasticity/version.rb @@ -1,3 +1,3 @@ module Elasticity - VERSION = "0.8.2" + VERSION = "0.8.3" end