Skip to content

Commit

Permalink
Revert "get collection indexing working"
Browse files Browse the repository at this point in the history
This reverts commit 688da28.
  • Loading branch information
lsitu authored and tamsin johnson committed Aug 29, 2023
1 parent 2df1b9a commit 84f9524
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 10 deletions.
1 change: 0 additions & 1 deletion .koppie/app/forms/collection_resource_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
# Generated via
# `rails generate hyrax:collection_resource CollectionResource`
class CollectionResourceForm < Hyrax::Forms::PcdmCollectionForm
include Hyrax::FormFields(:basic_metadata)
include Hyrax::FormFields(:collection_resource)
end
1 change: 0 additions & 1 deletion .koppie/app/indexers/collection_resource_indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
# Generated via
# `rails generate hyrax:collection_resource CollectionResource`
class CollectionResourceIndexer < Hyrax::PcdmCollectionIndexer
include Hyrax::Indexer(:basic_metadata)
include Hyrax::Indexer(:collection_resource)
end
1 change: 0 additions & 1 deletion .koppie/app/models/collection_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@ class CollectionResource < Hyrax::PcdmCollection
# * add Valkyrie attributes to this class
# * update form and indexer to process the attributes
#
include Hyrax::Schema(:basic_metadata)
include Hyrax::Schema(:collection_resource)
end
129 changes: 128 additions & 1 deletion .koppie/config/metadata/collection_resource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,131 @@
# Generated via
# `rails generate hyrax:collection_resource CollectionResource`

attributes: {}
attributes:
description:
type: string
multiple: true
form:
primary: true
index_keys:
- "description_tesim"
creator:
type: string
multiple: true
form:
required: false
primary: false
index_keys:
- "creator_tesim"
rights_statement:
type: string
multiple: true
form:
primary: false
abstract:
type: string
multiple: true
form:
primary: false
access_right:
type: string
multiple: true
form:
primary: false
alternative_title:
type: string
multiple: true
form:
primary: false
based_near:
type: string
multiple: true
form:
primary: false
index_keys:
- "based_near_sim"
- "based_near_tesim"
bibliographic_citation:
type: string
multiple: true
contributor:
type: string
multiple: true
form:
primary: false
date_created:
type: date_time
multiple: true
form:
primary: false
index_keys:
- "date_created_tesim"
identifier:
type: string
multiple: true
form:
primary: false
import_url:
type: string
keyword:
type: string
multiple: true
index_keys:
- "keyword_sim"
- "keyword_tesim"
form:
primary: false
publisher:
type: string
multiple: true
form:
primary: false
label:
type: string
form:
primary: false
language:
type: string
multiple: true
form:
primary: false
license:
type: string
multiple: true
form:
primary: false
relative_path:
type: string
related_url:
type: string
multiple: true
form:
primary: false
index_keys:
- "related_url_tesim"
resource_type:
type: string
multiple: true
form:
primary: false
index_keys:
- "resource_type_sim"
- "resource_type_tesim"
rights_notes:
type: string
multiple: true
form:
primary: false
source:
type: string
multiple: true
form:
primary: false
subject:
type: string
multiple: true
index_keys:
- "subject_sim"
- "subject_tesim"
form:
primary: false
6 changes: 0 additions & 6 deletions app/indexers/hyrax/pcdm_collection_indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ def to_solr
index_document[:member_of_collection_ids_ssim] = resource.member_of_collection_ids.map(&:to_s)
index_document[:depositor_ssim] = [resource.depositor]
index_document[:depositor_tesim] = [resource.depositor]
# add all attributes that should be indexed for collections here
tesim_and_ssim_attributes = ['abstract', 'access_right', 'alternative_title', 'based_near', 'bibliographic_citation', 'contributor', 'identifier', 'import_url', 'publisher', 'label', 'language', 'license', 'publisher', 'rights_notes', 'rights_statement', 'source', 'subject']
tesim_and_ssim_attributes.each do |attribute|
index_document["#{attribute}_ssim"] = resource["#{attribute}"]
index_document["#{attribute}_tesim"] = resource["#{attribute}"]
end
end
end
end
Expand Down

0 comments on commit 84f9524

Please sign in to comment.