Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

[HOLD - doing report first] Update sw_subject_geographic_ssim to use stanford-mods.subjects.geographic_facet #1010

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion app/indexers/descriptive_metadata_indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def to_solr
'contributor_orcids_ssim' => orcids,
'sw_display_title_tesim' => title,
'sw_subject_temporal_ssim' => subject_temporal,
'sw_subject_geographic_ssim' => subject_geographic,
'sw_subject_geographic_ssim' => stanford_mods_record.geographic_facet.uniq,
Copy link
Member

Choose a reason for hiding this comment

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

It looks like all the test changes below are negative tests now. What does the change now map to?

'sw_pub_date_facet_ssi' => pub_year,
'originInfo_date_created_tesim' => creation_date,
'originInfo_publisher_tesim' => publisher_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@
}
end

it 'maps the code to text' do
expect(doc).to include('sw_subject_geographic_ssim' => ['Russia (Federation)'])
it 'does not map the code to text' do
expect(doc).not_to include('sw_subject_geographic_ssim' => ['Russia (Federation)'])
end
end

Expand Down Expand Up @@ -318,8 +318,8 @@
}
end

it 'maps the code to text' do
expect(doc).to include('sw_subject_geographic_ssim' => ['Russia (Federation)'])
it 'does not map the code to text' do
expect(doc).not_to include('sw_subject_geographic_ssim' => ['Russia (Federation)'])
end
end

Expand Down Expand Up @@ -416,8 +416,8 @@
}
end

it 'includes term once' do
expect(doc).to include('sw_subject_geographic_ssim' => ['Russia (Federation)'])
it 'does not include the term' do
expect(doc).not_to include('sw_subject_geographic_ssim' => ['Russia (Federation)'])
end
end

Expand All @@ -442,8 +442,8 @@
}
end

it 'includes both terms' do
expect(doc).to include('sw_subject_geographic_ssim' => ['Russia', 'Russia (Federation)'])
it 'does not include both terms' do
expect(doc).not_to include('sw_subject_geographic_ssim' => ['Russia', 'Russia (Federation)'])
end
end

Expand Down Expand Up @@ -658,30 +658,5 @@
expect(doc).to include('sw_subject_geographic_ssim' => ['Europe'])
end
end

context 'when terminal punctuation should be dropped from code' do
let(:description) do
{
title: [
{
value: 'title'
}
],
subject: [
{
code: 'e-ru;',
type: 'place',
source: {
code: 'marcgac'
}
}
]
}
end

it 'drops the punctuation' do
expect(doc).to include('sw_subject_geographic_ssim' => ['Russia (Federation)'])
end
end
end
end