diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index fbea25c8..15e46a92 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -22,6 +22,14 @@ def self.title_field 'title_ssi' end + def self.published_field + 'date_issued_d_ssi' + end + + def self.created_field + 'date_created_d_ssi' + end + # CatalogController-scope behavior and configuration for BlacklightIiifSearch include BlacklightIiifSearch::Controller @@ -396,6 +404,10 @@ def self.title_field config.add_sort_field "#{uploaded_field} asc", label: "date uploaded \u25B2" config.add_sort_field "#{modified_field} desc", label: "date modified \u25BC" config.add_sort_field "#{modified_field} asc", label: "date modified \u25B2" + config.add_sort_field "#{published_field} desc", label: "date published \u25BC" + config.add_sort_field "#{published_field} asc", label: "date published \u25B2" + config.add_sort_field "#{created_field} desc", label: "date created \u25BC" + config.add_sort_field "#{created_field} asc", label: "date created \u25B2" # OAI Config fields config.oai = { diff --git a/app/indexers/collection_indexer.rb b/app/indexers/collection_indexer.rb index 2a7d63da..097e8e71 100644 --- a/app/indexers/collection_indexer.rb +++ b/app/indexers/collection_indexer.rb @@ -13,6 +13,8 @@ def generate_solr_document solr_doc["bulkrax_identifier_sim"] = object.bulkrax_identifier solr_doc["account_cname_tesim"] = Site.instance&.account&.cname solr_doc[CatalogController.title_field] = object.title.first + solr_doc[CatalogController.published_field] = object.date_issued_d + solr_doc[CatalogController.created_field] = object.date_created_d end end