From 6249895187acae3c32ccc64e6c9ec9010a334c86 Mon Sep 17 00:00:00 2001 From: Randall Floyd Date: Wed, 13 Dec 2023 11:59:45 -0500 Subject: [PATCH] Removing ssm versions of physdesc fields since tesim is both stored and indexed. --- lib/arclight/traject/ead2_component_config.rb | 9 +-------- lib/arclight/traject/ead2_config.rb | 9 +-------- .../arclight/templates/catalog_controller.rb | 4 ++-- spec/features/traject/ead2_indexing_spec.rb | 20 +++++++++---------- 4 files changed, 14 insertions(+), 28 deletions(-) diff --git a/lib/arclight/traject/ead2_component_config.rb b/lib/arclight/traject/ead2_component_config.rb index 9a3791331..b4fb5beed 100644 --- a/lib/arclight/traject/ead2_component_config.rb +++ b/lib/arclight/traject/ead2_component_config.rb @@ -156,7 +156,7 @@ end # This accumulates direct text from a physdesc, ignoring child elements handled elsewhere -to_field 'physdesc_ssm', extract_xpath('./did/physdesc', to_text: false) do |_record, accumulator| +to_field 'physdesc_tesim', extract_xpath('./did/physdesc', to_text: false) do |_record, accumulator| accumulator.map! do |element| physdesc = [] element.children.map do |child| @@ -168,10 +168,6 @@ end end -to_field 'physdesc_tesim' do |_record, accumulator, context| - accumulator.concat context.output_hash['physdesc_ssm'] || [] -end - to_field 'extent_ssm' do |record, accumulator| physdescs = record.xpath('./did/physdesc') extents_per_physdesc = physdescs.map do |physdesc| @@ -188,10 +184,7 @@ accumulator.concat context.output_hash['extent_ssm'] || [] end -to_field 'physfacet_ssm', extract_xpath('./did/physdesc/physfacet') to_field 'physfacet_tesim', extract_xpath('./did/physdesc/physfacet') - -to_field 'dimensions_ssm', extract_xpath('./did/physdesc/dimensions') to_field 'dimensions_tesim', extract_xpath('./did/physdesc/dimensions') to_field 'creator_ssm', extract_xpath('./did/origination') diff --git a/lib/arclight/traject/ead2_config.rb b/lib/arclight/traject/ead2_config.rb index b18c42d14..0fcb55128 100644 --- a/lib/arclight/traject/ead2_config.rb +++ b/lib/arclight/traject/ead2_config.rb @@ -184,7 +184,7 @@ end # This accumulates direct text from a physdesc, ignoring child elements handled elsewhere -to_field 'physdesc_ssm', extract_xpath('/ead/archdesc/did/physdesc', to_text: false) do |_record, accumulator| +to_field 'physdesc_tesim', extract_xpath('/ead/archdesc/did/physdesc', to_text: false) do |_record, accumulator| accumulator.map! do |element| physdesc = [] element.children.map do |child| @@ -196,10 +196,6 @@ end end -to_field 'physdesc_tesim' do |_record, accumulator, context| - accumulator.concat context.output_hash['physdesc_ssm'] || [] -end - to_field 'extent_ssm' do |record, accumulator| physdescs = record.xpath('/ead/archdesc/did/physdesc') extents_per_physdesc = physdescs.map do |physdesc| @@ -216,10 +212,7 @@ accumulator.concat context.output_hash['extent_ssm'] || [] end -to_field 'physfacet_ssm', extract_xpath('/ead/archdesc/did/physdesc/physfacet') to_field 'physfacet_tesim', extract_xpath('/ead/archdesc/did/physdesc/physfacet') - -to_field 'dimensions_ssm', extract_xpath('/ead/archdesc/did/physdesc/dimensions') to_field 'dimensions_tesim', extract_xpath('/ead/archdesc/did/physdesc/dimensions') to_field 'genreform_ssim', extract_xpath('/ead/archdesc/controlaccess/genreform') diff --git a/lib/generators/arclight/templates/catalog_controller.rb b/lib/generators/arclight/templates/catalog_controller.rb index 2c4985bd2..b4510482d 100644 --- a/lib/generators/arclight/templates/catalog_controller.rb +++ b/lib/generators/arclight/templates/catalog_controller.rb @@ -279,8 +279,8 @@ class CatalogController < ApplicationController config.add_background_field 'accruals', field: 'accruals_html_tesm', helper_method: :render_html_tags config.add_background_field 'phystech', field: 'phystech_html_tesm', helper_method: :render_html_tags config.add_background_field 'physloc', field: 'physloc_html_tesm', helper_method: :render_html_tags - config.add_background_field 'physfacet', field: 'physfacet_ssm', helper_method: :render_html_tags - config.add_background_field 'dimensions', field: 'dimensions_ssm', helper_method: :render_html_tags + config.add_background_field 'physfacet', field: 'physfacet_tesim', helper_method: :render_html_tags + config.add_background_field 'dimensions', field: 'dimensions_tesim', helper_method: :render_html_tags config.add_background_field 'materialspec', field: 'materialspec_tesim', helper_method: :render_html_tags config.add_background_field 'fileplan', field: 'fileplan_html_tesim', helper_method: :render_html_tags config.add_background_field 'descrules', field: 'descrules_ssm', helper_method: :render_html_tags diff --git a/spec/features/traject/ead2_indexing_spec.rb b/spec/features/traject/ead2_indexing_spec.rb index e4c59c8fb..a56a107a6 100644 --- a/spec/features/traject/ead2_indexing_spec.rb +++ b/spec/features/traject/ead2_indexing_spec.rb @@ -122,19 +122,19 @@ def components(result) describe 'physdesc' do it 'direct text' do - expect(result['physdesc_ssm']).to equal_array_ignoring_whitespace ['Photographic album', 'Single bound volume'] + expect(result['physdesc_tesim']).to equal_array_ignoring_whitespace ['Photographic album', 'Single bound volume'] end it 'extent' do - expect(result['extent_ssm']).to equal_array_ignoring_whitespace ['1.25 Linear Feet (1 volume)', '1 document case', '16 DVDRs'] + expect(result['extent_tesim']).to equal_array_ignoring_whitespace ['1.25 Linear Feet (1 volume)', '1 document case', '16 DVDRs'] end it 'physfacet' do - expect(result['physfacet_ssm']).to equal_array_ignoring_whitespace ['Printed material', 'Digital Video Disc'] + expect(result['physfacet_tesim']).to equal_array_ignoring_whitespace ['Printed material', 'Digital Video Disc'] end it 'dimensions' do - expect(result['dimensions_ssm']).to equal_array_ignoring_whitespace ['20 x 20 in.', '7.5 x 5.5 in.'] + expect(result['dimensions_tesim']).to equal_array_ignoring_whitespace ['20 x 20 in.', '7.5 x 5.5 in.'] end end @@ -311,7 +311,7 @@ def components(result) describe 'physdesc at the collection level' do it 'direct text' do - expect(result['physdesc_ssm']).to equal_array_ignoring_whitespace ['Boxes and folders', 'Compact discs'] + expect(result['physdesc_tesim']).to equal_array_ignoring_whitespace ['Boxes and folders', 'Compact discs'] end it 'extent' do @@ -321,11 +321,11 @@ def components(result) end it 'physfacet' do - expect(result['physfacet_ssm']).to equal_array_ignoring_whitespace ['Compact digital disc'] + expect(result['physfacet_tesim']).to equal_array_ignoring_whitespace ['Compact digital disc'] end it 'dimensions' do - expect(result['dimensions_ssm']).to equal_array_ignoring_whitespace ['7.5 x 5.5 in.'] + expect(result['dimensions_tesim']).to equal_array_ignoring_whitespace ['7.5 x 5.5 in.'] end end @@ -335,7 +335,7 @@ def components(result) end it 'direct text' do - expect(component['physdesc_ssm']).to equal_array_ignoring_whitespace ['Cards and sheets of various sizes'] + expect(component['physdesc_tesim']).to equal_array_ignoring_whitespace ['Cards and sheets of various sizes'] end it 'extent' do @@ -347,11 +347,11 @@ def components(result) end it 'physfacet' do - expect(component['physfacet_ssm']).to equal_array_ignoring_whitespace ['Informational cards'] + expect(component['physfacet_tesim']).to equal_array_ignoring_whitespace ['Informational cards'] end it 'dimensions' do - expect(component['dimensions_ssm']).to equal_array_ignoring_whitespace ['various'] + expect(component['dimensions_tesim']).to equal_array_ignoring_whitespace ['various'] end end