Skip to content

Instantly share code, notes, and snippets.

@rishabg
rishabg / sunspot_tasks.rake
Created July 24, 2020 04:10 — forked from lassebunk/sunspot_tasks.rake
Reindex Sunspot Solr gracefully
# This task can be used reindex Solr without dropping your index first.
# This is ideal for production environments where a live, working index is critical.
#
# Put this in lib/tasks/sunspot_tasks.rake
namespace :sunspot do
task reindex_gracefully: :environment do
Dir.glob(Rails.root.join('app/models/**/*.rb')).each { |path| require path }
sunspot_models = Sunspot.searchable
@rishabg
rishabg / about.md
Created August 14, 2011 04:29 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer