Skip to content

Instantly share code, notes, and snippets.

Avatar

curlyheads curlyheads

  • prometheus
  • Germany
View GitHub Profile
@jarosan
jarosan / elasticsearch.rake
Created Jul 16, 2012
Elasticsearch reindex task
View elasticsearch.rake
# Run with: rake environment elasticsearch:reindex
namespace :elasticsearch do
desc "re-index elasticsearch"
task :reindex => :environment do
klass = Place
ENV['CLASS'] = klass.name
ENV['INDEX'] = new_index = klass.tire.index.name << '_' << Time.now.strftime('%Y%m%d%H%M%S')