Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure collection_titles_ssim as the default collection field; deprecate collection_with_title #2727

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

corylown
Copy link
Contributor

Fixes #810

After this is deployed to production I will run a script from the Rails console to update all the custom configurations to use the new field:

Spotlight::BlacklightConfiguration.find_each do |config|
  old_index_config = config.index_fields['collection_with_title'] || {"label"=>"Collection", "list"=>true, "gallery"=>false, "heatmaps"=>true, "masonry"=>false, "slideshow"=>false, "show"=>true, "enabled"=>true}
  config.update(
    index_fields: config.index_fields.merge({
      'collection_with_title' => { 'enabled' => false, 'show' => false },
      'collection_titles_ssim' => old_index_config
    })
  ) unless config.index_fields.blank?
  
  old_facet_config = config.facet_fields['collection_with_title'] || {"show"=>true, "label"=>"Collection", "sort"=>"count"}
  config.update(
    facet_fields: config.facet_fields.merge({
      'collection_with_title' => { 'show' => false },
      'collection_titles_ssim' => old_facet_config
    })
  ) unless config.facet_fields.blank?
end

Some exhibits will need to be manually configured either because they don't set a custom configuration or they need to continue to use the deprecated collection field (because they can't be re-indexed):

Manually configure to use the deprecated facet field:

  • views-portraying-place-space (facet and index)
  • gordon-maps (facet and index)
  • chinese-ngos (index only, facet off)

Manually configure facet to use new field and turn off old field because they do no have a configuration set:

  • ai
  • conservation
  • awards
  • calligraphy
  • seaside
  • dataviz

@jcoyne jcoyne merged commit 3ae5f87 into main Dec 13, 2024
2 checks passed
@jcoyne jcoyne deleted the 810-collection-title branch December 13, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A-Z sort in collections facet not working correctly
2 participants