Commit eb56fa14f274c99e9cf42fee3bdee51cdedee3c2

Authored by Andrew Kane
1 parent d804f1fe

Removed model name

Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
lib/searchkick/reindex.rb
... ... @@ -36,9 +36,9 @@ module Searchkick
36 36 # remove old indices that start w/ index_name
37 37 def clean_indices
38 38 all_indices = JSON.parse(Tire::Configuration.client.get("#{Tire::Configuration.url}/_aliases").body)
39   - indices = all_indices.select{|k, v| v["aliases"].empty? && k =~ /\A#{Regexp.escape(Product.index_name)}_\d{14}\z/ }.keys
40   - indices.each do |index_name|
41   - Tire::Index.new(index_name).delete
  39 + indices = all_indices.select{|k, v| v["aliases"].empty? && k =~ /\A#{Regexp.escape(index_name)}_\d{14}\z/ }.keys
  40 + indices.each do |index|
  41 + Tire::Index.new(index).delete
42 42 end
43 43 indices
44 44 end
... ...