From dd61e0c966e08168f683cabf01e9854bda610c28 Mon Sep 17 00:00:00 2001 From: Kirk Wang Date: Thu, 1 Feb 2024 16:12:58 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Fix=20set=20child=20flag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit will make sure that the set child flag transaction fires when ingesting with Bulkrax. Also fixed a weird bug where the extra space in the query was causing the query to fail. --- app/indexers/concerns/hyku_indexing.rb | 3 ++- app/models/solr_document.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/indexers/concerns/hyku_indexing.rb b/app/indexers/concerns/hyku_indexing.rb index ad06ade65..4b63331b6 100644 --- a/app/indexers/concerns/hyku_indexing.rb +++ b/app/indexers/concerns/hyku_indexing.rb @@ -10,7 +10,7 @@ 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 @@ -18,6 +18,7 @@ module HykuIndexing 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) # 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 diff --git a/app/models/solr_document.rb b/app/models/solr_document.rb index d3b733fb9..6e4051402 100644 --- a/app/models/solr_document.rb +++ b/app/models/solr_document.rb @@ -80,7 +80,7 @@ def show_pdf_download_button # @return [Array] 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