Sha256: fbf2a621b848641c1923749f96623b87a56a4771da4646a52e8154b704deb123
Contents?: true
Size: 1.08 KB
Versions: 18
Compression:
Stored size: 1.08 KB
Contents
namespace :fcrepo_admin do namespace :solr do desc "Deletes everything from the Solr index" task :clean => :environment do Blacklight.solr.delete_by_query("*:*") Blacklight.solr.commit end desc "Index a single object in solr specified by PID=" task :index => :environment do raise "Must specify a pid. Ex: PID=changeme:12" unless ENV['PID'] ActiveFedora::Base.connection_for_pid('foo:1') # Loads Rubydora connection with fake object ActiveFedora::Base.find(ENV['PID'], cast: true).update_index end desc 'Index all objects in the repository (except fedora-system: objects).' task :index_all => :environment do ActiveFedora::Base.connection_for_pid('foo:1') # Loads Rubydora connection with fake object ActiveFedora::Base.fedora_connection[0].connection.search(nil) do |object| if !object.pid.starts_with?('fedora-system:') ActiveFedora::Base.find(object.pid, cast: true).update_index end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems