Skip to content

Commit

Permalink
Allow indexing a resource for the first time by manifest
Browse files Browse the repository at this point in the history
refs #533
  • Loading branch information
hackartisan committed Sep 15, 2020
1 parent 24eb055 commit 973529a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/tasks/index.rake
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ namespace :reindex do
end
end

desc 'Reindex a resource from a IIIF Manifest URL within an Exhibit'
desc 'Index or reindex a resource from a IIIF Manifest URL within an Exhibit'
task :manifest, %i[manifest exhibit] => [:environment] do |_t, args|
manifest = args[:manifest]
exhibit_slug = args[:exhibit]
exhibit = Spotlight::Exhibit.find_by(slug: exhibit_slug)
iiif_resource = IIIFResource.find_by(url: manifest, exhibit: exhibit)
iiif_resource = IIIFResource.find_or_initialize_by(url: manifest, exhibit: exhibit)
iiif_resource.save_and_index_now
puts "Reindexed the document for #{manifest}"
end
Expand Down

0 comments on commit 973529a

Please sign in to comment.