This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| # 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 |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer