Skip to content
Browse files

Add task to refill search_results titles

  • Loading branch information...
1 parent 226cee2 commit 4f61bd01fab67434511da93f85cf9261fa10afc5 Ricardo Panaggio committed Nov 10, 2011
Showing with 15 additions and 0 deletions.
  1. +15 −0 lib/tasks/search_results.rake
View
15 lib/tasks/search_results.rake
@@ -24,4 +24,19 @@ namespace :search_results do
end
end
end
+
+ desc "Refill titles"
+ task :refill_titles => :environment do
+ SearchResult.find_each(:batch_size => 10_000) do |sr|
+ old_title = sr.title
+ sr.send('fetch_response_body')
+ sr.send('fill_title')
+ if sr.title != old_title
+ sr.set(:title => sr.title)
+ print 'C'
+ else
+ print '.'
+ end
+ end
+ end
end

0 comments on commit 4f61bd0

Please sign in to comment.
Something went wrong with that request. Please try again.