app/models/concerns/arclight/solr_document.rb in arclight-1.0.1 vs app/models/concerns/arclight/solr_document.rb in arclight-1.1.0

- old
+ new

@@ -5,15 +5,15 @@ # Extends Blacklight::Solr::Document to provide Arclight specific behavior module SolrDocument extend ActiveSupport::Concern included do - attribute :parent_ids, :array, 'parent_ssim' + attribute :parent_ids, :array, 'parent_ids_ssim' attribute :parent_labels, :array, 'parent_unittitles_ssm' attribute :parent_levels, :array, 'parent_levels_ssm' attribute :unitid, :string, 'unitid_ssm' - attribute :extent, :string, 'extent_ssm' + attribute :extent, :array, 'extent_ssm' attribute :abstract, :string, 'abstract_html_tesm' attribute :scope, :string, 'scopecontent_html_tesm' attribute :creator, :string, 'creator_ssm' attribute :level, :string, 'level_ssm' attribute :terms, :string, 'userestrict_html_tesm' @@ -109,11 +109,16 @@ Arclight::DigitalObject.from_json(object) end end def containers - # NOTE: that .titlecase strips punctuation, like hyphens, we want to keep - fetch('containers_ssim', []).map(&:capitalize) + # NOTE: Keep uppercase characters if present, but upcase the first if not already + containers_field = fetch('containers_ssim', []).reject(&:empty?) + return [] if containers_field.blank? + + containers_field.map do |container| + container.dup.sub!(/\A./, &:upcase) + end end # @return [Array<String>] with embedded highlights using <em>...</em> def highlights highlight_field(CatalogController.blacklight_config.highlight_field)