Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧹 Fix relationship links #2161

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/indexers/concerns/hyku_indexing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ module HykuIndexing
define_method method_name do |*args, **kwargs, &block|
super(*args, **kwargs, &block).tap do |solr_doc|
# rubocop:disable Style/ClassCheck

# specs refer to object as @object
object ||= @object || resource

solr_doc['account_cname_tesim'] = Site.instance&.account&.cname
solr_doc['bulkrax_identifier_tesim'] = object.bulkrax_identifier if object.respond_to?(:bulkrax_identifier)
solr_doc['account_institution_name_ssim'] = Site.instance.institution_label
solr_doc['valkyrie_bsi'] = object.kind_of?(Valkyrie::Resource)
solr_doc['member_ids_ssim'] = object.member_ids.map(&:id)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: We may need a valkyrie check here? valkyrie member ids returns valkyrie objects with id keys, allowing us to map (:id). Active Fedora's member_ids are just ids.

# TODO: Reinstate once valkyrie fileset work is complete - https://github.com/scientist-softserv/hykuup_knapsack/issues/34
solr_doc['all_text_tsimv'] = full_text(object.file_sets.first&.id) if object.kind_of?(ActiveFedora::Base)
# rubocop:enable Style/ClassCheck
Expand Down
2 changes: 1 addition & 1 deletion app/models/solr_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def show_pdf_download_button

# @return [Array<SolrDocument>] a list of solr documents in no particular order
def load_parent_docs
query("member_ids_ssim: #{id}", rows: 1000)
query("member_ids_ssim:#{id}", rows: 1000)
.map { |res| ::SolrDocument.new(res) }
end

Expand Down
Loading