• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / bibdata / f04bc944-f9b4-4a42-8b26-dcacd0e3e688

11 Mar 2025 10:27PM UTC coverage: 34.017% (-58.1%) from 92.162%
f04bc944-f9b4-4a42-8b26-dcacd0e3e688

Pull #2653

circleci

christinach
Add new lc_subject_facet field.
Helps with the vocabulary work https://github.com/pulibrary/orangelight/pull/3386
In this new field we index only the lc subject heading and the subdivisions
So that when the user searches using the Details section, they can query solr for
all the subject headings and their divisions.

This is needed for the Subject browse Vocabulary work.
example: "lc_subject_facet": [
             "Booksellers and bookselling—Italy—Directories",
             "Booksellers and bookselling-Italy",
             "Booksellers and bookselling"
              ]
Pull Request #2653: Add new lc_subject_facet field.

1 of 3 new or added lines in 1 file covered. (33.33%)

2215 existing lines in 93 files now uncovered.

1294 of 3804 relevant lines covered (34.02%)

0.99 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/app/adapters/alma_adapter/recap_alma_holding.rb
UNCOV
1
class AlmaAdapter
×
2
  # Handle the differences in holding enrichments done for ReCAP only.
UNCOV
3
  class RecapAlmaHolding < AlmaHolding
×
4
    # ReCAP can't handle a call number with both an 'h' and an 'i' subfield, so
5
    # combine them both into 'h'
UNCOV
6
    def enriched_852
×
UNCOV
7
      super.map do |original_field|
×
UNCOV
8
        original_field.tap do |field|
×
UNCOV
9
          call_no = callno_from_852(field)
×
UNCOV
10
          field.subfields.delete_if { |s| %w[h i].include? s.code }
×
UNCOV
11
          field.append(MARC::Subfield.new('h', call_no))
×
UNCOV
12
          combine_location(field)
×
UNCOV
13
        end
×
UNCOV
14
      end
×
UNCOV
15
    end
×
16

UNCOV
17
    private
×
18

19
      # We need to combine 852 b/c for recap.
UNCOV
20
      def combine_location(field)
×
UNCOV
21
        return if field['b'].to_s.include?('$')
×
22

UNCOV
23
        b_code = "#{field['b']}$#{field['c']}"
×
UNCOV
24
        field.subfields.delete_if { |s| s.code == 'b' }
×
UNCOV
25
        field.append(MARC::Subfield.new('b', b_code))
×
UNCOV
26
      end
×
27

28
      # Copied from VoyagerHelpers. Combines h and i into one callnumber.
UNCOV
29
      def callno_from_852(field)
×
UNCOV
30
        call_no = field['h']
×
UNCOV
31
        return call_no if call_no.nil?
×
32

UNCOV
33
        call_no << (' ' + field['i']) if field['i']
×
UNCOV
34
        call_no.gsub!(/^[[:blank:]]+(.*)$/, '\1')
×
UNCOV
35
        call_no
×
UNCOV
36
      end
×
UNCOV
37
  end
×
UNCOV
38
end
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc