From 6853be39001267dfd893bc1c552c78dd88376f53 Mon Sep 17 00:00:00 2001 From: Anusha Ranganathan Date: Thu, 5 Feb 2026 19:38:54 +0530 Subject: [PATCH] Added title sort, changed label and modified collections facet --- spotlight/app/controllers/catalog_controller.rb | 8 +++++++- spotlight/config/locales/blacklight.en.yml | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/spotlight/app/controllers/catalog_controller.rb b/spotlight/app/controllers/catalog_controller.rb index 2cec8f4..a71737e 100644 --- a/spotlight/app/controllers/catalog_controller.rb +++ b/spotlight/app/controllers/catalog_controller.rb @@ -13,6 +13,10 @@ def self.modified_field 'system_modified_dtsi' end + def self.title_sort + "title_ansort" + end + configure_blacklight do |config| #config.show.oembed_field = :oembed_url_ssm #config.show.partials.insert(1, :oembed) @@ -50,7 +54,7 @@ def self.modified_field # solr fields that will be treated as facets by the blacklight application # The ordering of the field names is the order of the display config.add_facet_field "human_readable_type_sim", label: "Type", limit: 5 - config.add_facet_field "member_of_collection_ids_ssim", label: 'Collections', sort: 'count' + config.add_facet_field "member_of_collections_ssim", label: 'Collections', sort: 'count' config.add_facet_field "year_sim", label: "Year", limit: 5, sort: 'index desc' config.add_facet_field "creator_sim", label: "Creator", limit: 5, sort: 'index', index_range: 'A'..'Z' config.add_facet_field "advisor_sim", label: "Advisor", limit: 5, sort: 'index', index_range: 'A'..'Z' @@ -300,6 +304,8 @@ def self.modified_field # except in the relevancy case). # label is key, solr field is value config.add_sort_field 'relevance', sort: "score desc, #{uploaded_field} desc", label: I18n.t('spotlight.search.fields.sort.relevance') + config.add_sort_field 'title_desc', sort: "#{title_sort} desc", label: "Title \u25BC" + config.add_sort_field 'title_asc', sort: "#{title_sort} asc", label: "Title \u25B2" config.add_sort_field 'date_uploaded_desc', sort: "#{uploaded_field} desc", label: "date uploaded \u25BC" config.add_sort_field 'date_uploaded_asc', sort: "#{uploaded_field} asc", label: "date uploaded \u25B2" config.add_sort_field 'date_modified_desc', sort: "#{modified_field} desc", label: "date modified \u25BC" diff --git a/spotlight/config/locales/blacklight.en.yml b/spotlight/config/locales/blacklight.en.yml index 541c7a6..0f18b13 100644 --- a/spotlight/config/locales/blacklight.en.yml +++ b/spotlight/config/locales/blacklight.en.yml @@ -1,6 +1,7 @@ en: blacklight: application_name: 'Digital WPI' + back_to_search: 'Previous Page' footer: copyright_html: "Copyright © 2018 Samvera Licensed under the Apache License, Version 2.0" service_html: A service of Samvera.