lib/searchkick/index.rb in searchkick-3.1.3 vs lib/searchkick/index.rb in searchkick-4.0.0

- old
+ new

@@ -15,11 +15,11 @@ def create(body = {}) client.indices.create index: name, body: body end def delete - if !Searchkick.server_below?("6.0.0") && alias_exists? + if alias_exists? # can't call delete directly on aliases in ES 6 indices = client.indices.get_alias(name: name).keys client.indices.delete index: indices else client.indices.delete index: name @@ -66,10 +66,10 @@ query: {match_all: {}}, size: 0 } ) - response["hits"]["total"] + Searchkick::Results.new(nil, response).total_count end def promote(new_name, update_refresh_interval: false) if update_refresh_interval new_index = Searchkick::Index.new(new_name, @options)