app/jobs/solidus/elastic_product/reindex_job.rb
# Remove old indices that start with index_name
#
# borrowed from searchkick/lib/searchkick/index.rb:167
Remove old indices that start with index_name
borrowed from searchkick/lib/searchkick/index.rb:167
Remove old indices that start with index_name borrowed from searchkick / lib / searchkick / index . rb : 167
def cleanup
      indices = client.indices.get_aliases.
        select { |name, properties| properties.empty? || properties["aliases"].empty? }.
        select { |name, properties| name =~ /\A#{Regexp.escape(index_name)}_\d{14,17}\z/ }.keys
      indices.each do |index|
        Index.delete_index!(index: index)
        Rails.logger.info "elastic-product: Deleted index #{index}"
      end
    end
def cleanup indices = client . indices . get_aliases . select { | name , properties | properties . empty? || properties [ "aliases" ] . empty? } . select { | name , properties | name =~ / \A #{ Regexp . escape ( index_name ) } _ \d {14,17} \z / } . keys indices . each do | index | Index . delete_index! ( index : index ) Rails . logger . info "elastic-product: Deleted index #{index}" end end
Remove old indices that start with index_name
borrowed from searchkick/lib/searchkick/index.rb:167
Remove old indices that start with index_name borrowed from searchkick / lib / searchkick / index . rb : 167