Skip to content

Commit

Permalink
Remove change_the_subject flag
Browse files Browse the repository at this point in the history
Co-authored-by: Hector Correa <hector@hectorcorrea.com>
Co-authored-by: Bess Sadler <bess@ibiblio.org>
  • Loading branch information
3 people committed Oct 14, 2021
1 parent 3bea596 commit a4b1e43
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
16 changes: 8 additions & 8 deletions marc_to_solr/lib/traject_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -797,16 +797,16 @@
# 651 XX a{v--%}{x--%}{y--%}{z--%} S avxyz
to_field 'lc_subject_display' do |record, accumulator|
subjects = process_hierarchy(record, '600|*0|abcdfklmnopqrtvxyz:610|*0|abfklmnoprstvxyz:611|*0|abcdefgklnpqstvxyz:630|*0|adfgklmnoprstvxyz:650|*0|abcvxyz:651|*0|avxyz')
subjects = augment_the_subject.add_indigenous_studies(subjects) if ENV['CHANGE_THE_SUBJECT'] == 'true'
subjects = ChangeTheSubject.fix(subjects) if ENV['CHANGE_THE_SUBJECT'] == 'true'
subjects = augment_the_subject.add_indigenous_studies(subjects)
subjects = ChangeTheSubject.fix(subjects)
accumulator.replace(subjects)
end

# A field to include both archaic and replaced terms, for search purposes
to_field 'lc_subject_include_archaic_search_terms_index' do |record, accumulator|
subjects = process_hierarchy(record, '600|*0|abcdfklmnopqrtvxyz:610|*0|abfklmnoprstvxyz:611|*0|abcdefgklnpqstvxyz:630|*0|adfgklmnoprstvxyz:650|*0|abcvxyz:651|*0|avxyz')
new_subjects = augment_the_subject.add_indigenous_studies(subjects) if ENV['CHANGE_THE_SUBJECT'] == 'true'
new_subjects = ChangeTheSubject.fix(new_subjects) if ENV['CHANGE_THE_SUBJECT'] == 'true'
new_subjects = augment_the_subject.add_indigenous_studies(subjects)
new_subjects = ChangeTheSubject.fix(new_subjects)
combined_subjects = Array(subjects).concat(Array(new_subjects))&.uniq
accumulator.replace(combined_subjects)
end
Expand All @@ -826,8 +826,8 @@
# used for the browse lists and hierarchical subject/genre facet
to_field 'subject_facet' do |record, accumulator|
subjects = process_hierarchy(record, '600|*0|abcdfklmnopqrtvxyz:610|*0|abfklmnoprstvxyz:611|*0|abcdefgklnpqstvxyz:630|*0|adfgklmnoprstvxyz:650|*0|abcvxyz:651|*0|avxyz')
subjects = augment_the_subject.add_indigenous_studies(subjects) if ENV['CHANGE_THE_SUBJECT'] == 'true'
subjects = ChangeTheSubject.fix(subjects) if ENV['CHANGE_THE_SUBJECT'] == 'true'
subjects = augment_the_subject.add_indigenous_studies(subjects)
subjects = ChangeTheSubject.fix(subjects)
sk_subjects = process_hierarchy(record, '650|*7|abcvxyz', ['sk'])
genres = process_hierarchy(record, '655|*7|avxyz', ['lcgft', 'aat', 'rbbin', 'rbgenr', 'rbmscv', 'rbpap', 'rbpri', 'rbprov', 'rbpub', 'rbtyp'])
accumulator.replace([subjects, sk_subjects, genres].flatten)
Expand All @@ -853,8 +853,8 @@
# used for split subject topic facet
to_field 'subject_topic_facet' do |record, accumulator|
subjects = process_subject_topic_facet(record)
subjects = augment_the_subject.add_indigenous_studies(subjects) if ENV['CHANGE_THE_SUBJECT'] == 'true'
subjects = ChangeTheSubject.fix(subjects) if ENV['CHANGE_THE_SUBJECT'] == 'true'
subjects = augment_the_subject.add_indigenous_studies(subjects)
subjects = ChangeTheSubject.fix(subjects)
accumulator.replace(subjects)
end

Expand Down
1 change: 0 additions & 1 deletion spec/marc_to_solr/lib/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def fixture_record(fixture_name)

before(:all) do
stub_request(:get, "https://figgy.princeton.edu/catalog.json?f%5Bidentifier_tesim%5D%5B0%5D=ark&page=1&q=&rows=1000000")
ENV['CHANGE_THE_SUBJECT'] = 'true'
@indexer = IndexerService.build
@sample1 = @indexer.map_record(fixture_record('99276293506421'))
@sample2 = @indexer.map_record(fixture_record('993456823506421'))
Expand Down

0 comments on commit a4b1e43

Please sign in to comment.