Sha256: 2be35be90cce99a6639060e5a1f4ca5e98f5e18ba90634f9f64b590f8540d728

Contents?: true

Size: 835 Bytes

Versions: 11

Compression:

Stored size: 835 Bytes

Contents

namespace :blacklight do
  # task to clean out old, unsaved searches
  # rake blacklight:delete_old_searches[days_old]
  # example cron entry to delete searches older than 7 days at 2:00 AM every day: 
  # 0 2 * * * cd /path/to/your/app && /path/to/rake blacklight:delete_old_searches[7] RAILS_ENV=your_env
  desc "Removes entries in the searches table that are older than the number of days given."
  task :delete_old_searches, [:days_old] => [:environment] do |t, args|
    args.with_defaults(:days_old => 7)    
    Search.delete_old_searches(args[:days_old].to_i)
  end

  namespace :solr do
    desc "Put sample data into solr"
    task :seed do
      docs = YAML::load(File.open(File.join(Blacklight.root, 'solr', 'sample_solr_documents.yml')))
      Blacklight.solr.add docs
      Blacklight.solr.commit
    end
  end

end
  

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
blacklight-5.0.3 lib/railties/blacklight.rake
blacklight-5.1.1 lib/railties/blacklight.rake
blacklight-5.2.0 lib/railties/blacklight.rake
blacklight-5.1.0 lib/railties/blacklight.rake
blacklight-5.0.2 lib/railties/blacklight.rake
blacklight-5.0.1 lib/railties/blacklight.rake
blacklight-5.0.0 lib/railties/blacklight.rake
blacklight-5.0.0.pre4 lib/railties/blacklight.rake
blacklight-5.0.0.pre3 lib/railties/blacklight.rake
blacklight-5.0.0.pre2 lib/railties/blacklight.rake
blacklight-5.0.0.pre1 lib/railties/blacklight.rake