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

Version Path
fcrepo_admin-0.5.4 lib/tasks/fcrepo_admin.rake
fcrepo_admin-0.5.3 lib/tasks/fcrepo_admin.rake
fcrepo_admin-0.5.2 lib/tasks/fcrepo_admin.rake
fcrepo_admin-0.5.1 lib/tasks/fcrepo_admin.rake
fcrepo_admin-0.5.0 lib/tasks/fcrepo_admin.rake
fcrepo_admin-0.4.1 lib/tasks/fcrepo_admin.rake
fcrepo_admin-0.4.0 lib/tasks/fcrepo_admin.rake
fcrepo_admin-0.3.5 lib/tasks/fcrepo_admin.rake
fcrepo_admin-0.3.4 lib/tasks/fcrepo_admin.rake
fcrepo_admin-0.3.3 lib/tasks/fcrepo_admin.rake
fcrepo_admin-0.3.2 lib/tasks/fcrepo_admin.rake
fcrepo_admin-0.3.1 lib/tasks/fcrepo_admin.rake
fcrepo_admin-0.3.0 lib/tasks/fcrepo_admin.rake
fcrepo_admin-0.2.4 lib/tasks/fcrepo_admin.rake
fcrepo_admin-0.2.3 lib/tasks/fcrepo_admin.rake
fcrepo_admin-0.2.0 lib/tasks/fcrepo_admin.rake
fcrepo_admin-0.1.1 lib/tasks/fcrepo_admin.rake
fcrepo_admin-0.1.0 lib/tasks/fcrepo_admin.rake