I got an answer
desc "Updates the ferret index for the application."
task :ferret_index => [ :environment ] do | t |
MyModel.rebuild_index
puts "Completed Ferret Index Rebuild"
end
This task is simplified: I say that to restore the entire index every hour. I assume that when my dataset gets big enough, it will be very slow. In this case, I will need to track all instances of the model that have been updated in the last hour, and simply index them.
, cron , , "production":
cd /rails_app && rake ferret_index RAILS_ENV=production