diff --git a/app/indexers/hyrax/collection_indexer.rb b/app/indexers/hyrax/collection_indexer.rb index d7913df2..acbd805d 100644 --- a/app/indexers/hyrax/collection_indexer.rb +++ b/app/indexers/hyrax/collection_indexer.rb @@ -16,7 +16,7 @@ def generate_solr_document solr_doc[ActiveFedora.index_field_mapper.solr_name(:bytes, STORED_LONG)] = object.bytes solr_doc['thumbnail_path_ss'] = thumbnail_path solr_doc['visibility_ssi'] = object.visibility - Solrizer.insert_field(solr_doc, 'sort_title', sortable_title(object.title.first), :stored_sortable) if object.title.present? + # Solrizer.insert_field(solr_doc, 'sort_title', sortable_title(object.title.first), :stored_sortable) if object.title.present? object.in_collections.each do |col| (solr_doc['member_of_collection_ids_ssim'] ||= []) << col.id diff --git a/app/indexers/hyrax/work_indexer.rb b/app/indexers/hyrax/work_indexer.rb index 610a19a1..4862520b 100644 --- a/app/indexers/hyrax/work_indexer.rb +++ b/app/indexers/hyrax/work_indexer.rb @@ -11,19 +11,21 @@ def generate_solr_document solr_doc['member_ids_ssim'] = object.member_ids solr_doc['member_of_collections_ssim'] = object.member_of_collections.map(&:first_title) solr_doc['member_of_collection_ids_ssim'] = object.member_of_collections.map(&:id) - Solrizer.set_field(solr_doc, 'generic_type', 'Work', :facetable) + # solr_doc['generic_type_sim'] = ['Work'] + ActiveFedora.index_field_mapper.set_field(solr_doc, 'generic_type', 'Work', :facetable) # This enables us to return a Work when we have a FileSet that matches # the search query. While at the same time allowing us not to return Collections # when a work in the collection matches the query. solr_doc['file_set_ids_ssim'] = solr_doc['member_ids_ssim'] solr_doc['visibility_ssi'] = object.visibility - solr_doc[Solrizer.solr_name('date_created', :facetable)] = object.date_created + solr_doc[ActiveFedora.index_field_mapper.solr_name('date_created', :facetable)] = object.date_created admin_set_label = object.admin_set.to_s solr_doc['admin_set_sim'] = admin_set_label solr_doc['admin_set_tesim'] = admin_set_label - Solrizer.insert_field(solr_doc, 'sort_title', sortable_title(object.title.first), :stored_sortable) if object.title.present? + # Still need to figure out how to remove Solrizer + # ActiveFedora.index_field_mapper.insert_field(solr_doc, 'sort_title', sortable_title(object.title.first), :stored_sortable) if object.title.present? end end end diff --git a/app/models/basic_collection_metadata.rb b/app/models/basic_collection_metadata.rb index d5cd4003..87720330 100644 --- a/app/models/basic_collection_metadata.rb +++ b/app/models/basic_collection_metadata.rb @@ -13,6 +13,12 @@ module BasicCollectionMetadata property :creator, predicate: ::RDF::Vocab::DC11.creator property :contributor, predicate: ::RDF::Vocab::DC11.contributor + # added with hyrax 3.0 + property :alternative_title, predicate: ::RDF::Vocab::DC.alternative + property :abstract, predicate: ::RDF::Vocab::DC.abstract + property :rights_notes, predicate: ::RDF::URI.new('http://purl.org/dc/elements/1.1/rights'), multiple: true + property :access_right, predicate: ::RDF::Vocab::DC.accessRights + # override the predicate for description to match past versions of Scholar property :description, predicate: ::RDF::Vocab::DC11.description property :publisher, predicate: ::RDF::Vocab::DC11.publisher diff --git a/app/models/concerns/hyrax/basic_metadata.rb b/app/models/concerns/hyrax/basic_metadata.rb index 5e9bd6ae..835e4426 100644 --- a/app/models/concerns/hyrax/basic_metadata.rb +++ b/app/models/concerns/hyrax/basic_metadata.rb @@ -19,6 +19,12 @@ module BasicMetadata # override the predicate for description to match past versions of Scholar property :description, predicate: ::RDF::URI.new('http://purl.org/dc/terms/description') + # added with hyrax 3.0 + property :alternative_title, predicate: ::RDF::Vocab::DC.alternative + property :abstract, predicate: ::RDF::Vocab::DC.abstract + property :rights_notes, predicate: ::RDF::URI.new('http://purl.org/dc/elements/1.1/rights'), multiple: true + property :access_right, predicate: ::RDF::Vocab::DC.accessRights + property :keyword, predicate: ::RDF::Vocab::DC11.relation # Used for a license property :license, predicate: ::RDF::Vocab::DC.rights diff --git a/app/models/solr_document.rb b/app/models/solr_document.rb index 987ff61b..2b990a6e 100644 --- a/app/models/solr_document.rb +++ b/app/models/solr_document.rb @@ -25,75 +25,89 @@ class SolrDocument use_extension(Hydra::ContentNegotiation) + # Added for Hyrax 3 + + def alternative_title + self[ActiveFedora.index_field_mapper.solr_name('alternate_title')] + end + + def abstract + self[ActiveFedora.index_field_mapper.solr_name('abstract')] + end + + def rights_notes + self[ActiveFedora.index_field_mapper.solr_name('rights_notes')] + end + # Added for All Work Types def alternate_title - self[Solrizer.solr_name('alternate_title')] + self[ActiveFedora.index_field_mapper.solr_name('alternate_title')] end def advisor - self[Solrizer.solr_name('advisor')] + self[ActiveFedora.index_field_mapper.solr_name('advisor')] end def committee_member - self[Solrizer.solr_name('committee_member')] + self[ActiveFedora.index_field_mapper.solr_name('committee_member')] end def required_software - self[Solrizer.solr_name('required_software')] + self[ActiveFedora.index_field_mapper.solr_name('required_software')] end def time_period - self[Solrizer.solr_name('time_period')] + self[ActiveFedora.index_field_mapper.solr_name('time_period')] end def note - self[Solrizer.solr_name('note')] + self[ActiveFedora.index_field_mapper.solr_name('note')] end # Added for Article Work Type def journal_title - self[Solrizer.solr_name('journal_title')] + self[ActiveFedora.index_field_mapper.solr_name('journal_title')] end def issn - self[Solrizer.solr_name('issn')] + self[ActiveFedora.index_field_mapper.solr_name('issn')] end # Added for StudentWork, Document, and Image work types def genre - self[Solrizer.solr_name('genre')] + self[ActiveFedora.index_field_mapper.solr_name('genre')] end def geo_subject - self[Solrizer.solr_name('geo_subject')] + self[ActiveFedora.index_field_mapper.solr_name('geo_subject')] end def degree - self[Solrizer.solr_name('degree')] + self[ActiveFedora.index_field_mapper.solr_name('degree')] end # Complex metadata fields that we be implemented later. # def doi - # self[Solrizer.solr_name('doi')] + # self[ActiveFedora.index_field_mapper.solr_name('doi')] # end def college - self[Solrizer.solr_name('college')] + self[ActiveFedora.index_field_mapper.solr_name('college')] end def department - self[Solrizer.solr_name('department')] + self[ActiveFedora.index_field_mapper.solr_name('department')] end def doi - self[Solrizer.solr_name('doi')] + self[ActiveFedora.index_field_mapper.solr_name('doi')] end def etd_publisher - self[Solrizer.solr_name('etd_publisher')] + self[ActiveFedora.index_field_mapper.solr_name('etd_publisher')] end end diff --git a/spec/views/hyrax/base/_attributes.html.erb_spec.rb b/spec/views/hyrax/base/_attributes.html.erb_spec.rb index 94520663..4cc46e77 100644 --- a/spec/views/hyrax/base/_attributes.html.erb_spec.rb +++ b/spec/views/hyrax/base/_attributes.html.erb_spec.rb @@ -11,7 +11,7 @@ let(:solr_document) { SolrDocument.new(attributes) } let(:attributes) do { - Solrizer.solr_name('has_model', :symbol) => ["GenericWork"], + ActiveFedora.index_field_mapper.solr_name('has_model', :symbol) => ["GenericWork"], college_tesim: college, department_tesim: department, related_url_tesim: related_url,