From c18703d476f3094b58040cd3bef4306ba4ff5316 Mon Sep 17 00:00:00 2001 From: Rory McNicholl Date: Tue, 2 Jul 2024 15:37:14 +0100 Subject: [PATCH] we've already subclassed file_set_indexer so leave decorator alone for onel line change --- app/indexers/file_set_indexer.rb | 1 + .../hyrax/file_set_indexer_decorator.rb | 24 ------------------- 2 files changed, 1 insertion(+), 24 deletions(-) delete mode 100644 app/indexers/hyrax/file_set_indexer_decorator.rb diff --git a/app/indexers/file_set_indexer.rb b/app/indexers/file_set_indexer.rb index c95c91ca..e0a6cc6d 100644 --- a/app/indexers/file_set_indexer.rb +++ b/app/indexers/file_set_indexer.rb @@ -3,6 +3,7 @@ def generate_solr_document super.tap do |solr_doc| solr_doc['hasFormat_ssim'] = object.rendering_ids + solr_doc['digest_ssim'] = "urn:sha1:#{object.s3_only}" if object.s3_only.present? end rescue Ldp::HttpError => exception diff --git a/app/indexers/hyrax/file_set_indexer_decorator.rb b/app/indexers/hyrax/file_set_indexer_decorator.rb deleted file mode 100644 index d0578ae5..00000000 --- a/app/indexers/hyrax/file_set_indexer_decorator.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -# OVERRIDE Hyrax v3.5.0 to index the rdf_type on the FileSet - -module Hyrax - module FileSetIndexerDecorator - def generate_solr_document - super.tap do |solr_doc| - # digest of the original file if we are using an external file due to s3 direct upload - solr_doc['digest_ssim'] = "urn:sha1:#{object.s3_only}" if object.s3_only.present? - solr_doc['rdf_type_ssim'] = object.parent_works.first.rdf_type if attachment? - solr_doc['all_text_tesimv'] = solr_doc['all_text_tsimv'] if solr_doc['all_text_tsimv'].present? - end - end - - private - - def attachment? - object.parent_works.first.is_a?(Attachment) - end - end -end - -Hyrax::FileSetIndexer.prepend(Hyrax::FileSetIndexerDecorator)