From 87e2510d02fe79493fb82f8c2792de32c84a1834 Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Mon, 24 Sep 2012 18:46:38 +0800 Subject: [PATCH] add rake task for rebuild index --- lib/tasks/index.rake | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 lib/tasks/index.rake diff --git a/lib/tasks/index.rake b/lib/tasks/index.rake new file mode 100644 index 00000000..c6058ae8 --- /dev/null +++ b/lib/tasks/index.rake @@ -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 \ No newline at end of file