add rake task for rebuild index

This commit is contained in:
Matthew K. Fu JuYuan 2012-09-24 18:46:38 +08:00
parent 5634e87144
commit 87e2510d02
1 changed files with 11 additions and 0 deletions

11
lib/tasks/index.rake Normal file
View File

@ -0,0 +1,11 @@
# encoding: utf-8
namespace :index do
task :rebuild => :environment do
Sunspot.remove_all!
Sunspot.commit
Sunspot.index NewsBulletin.all
Sunspot.index Bulletin.all
Sunspot.commit
end
end