Closed jkeck closed 6 years ago
Something else to keep in mind with this is we update the configuration in a way that will require a bit of a solr data migration to make things work exactly right. There are 5 records in ePortfolios that will need to have their title and date field migrated to their new spotlight_upload_*
equivalents. Otherwise, when rending the edit form for these records, the title and date field will be blank even if data was filled out (since it is now referencing a field that has no data populated). We are going this way now to allow us to use solr copyFields instead of configuring them in the application layer.
Something along the lines of might work as a data migration
Spotlight::Resources::Upload.find_each do |upload|
data = upload.data
upload.data = data.merge(
'spotlight_upload_title_tesim': data['title']
'spotlight_upload_date_tesim': data['date']
).delete_if{ |_, v| v.nil? }
upload.save_and_index
end
Attempted to add the data migration in my comment above into a reversible migration in 18603e6ec29adb28c181dc14397da288bc791ee3
Not sure if this is even a good idea. Keeping it in a separate commit so feel free to remove it (or I'm happy to if I'm sill available).
includes commits from #23, #24, and #25 so those should be merged first
This will require updates to ePortfolio's sul-solr configs to match the change here.
NOTE: We will need to run the
spotlight:migrate_pages_language
when deploying this.