• 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

25.0
/app/services/index_functions.rb
1
module IndexFunctions
1✔
2
  def self.update_records(dump)
1✔
3
    file_paths = []
×
4
    dump['files']['updated_records'].each_with_index do |update, i|
×
5
      File.binwrite("/tmp/update_#{i}.gz", Faraday.get(update['dump_file']).body)
×
6
      file_paths << "/tmp/update_#{i}"
×
7
    end
8
    file_paths
×
9
  end
10

11
  def self.delete_ids(dump)
1✔
UNCOV
12
    dump['ids']['delete_ids']
×
13
  end
14

15
  def self.logger
1✔
UNCOV
16
    return Rails.logger if defined?(Rails)
×
17

18
    @logger ||= Logger.new(STDOUT)
×
19
  end
20

21
  def self.rsolr_connection(solr_url)
1✔
UNCOV
22
    RSolr.connect(url: solr_url, timeout: 300, open_timeout: 300)
×
23
  rescue StandardError => e
UNCOV
24
    logger.error "Failed to connect to Solr: #{e.message}"
×
UNCOV
25
    nil
×
26
  end
27

28
  def self.process_scsb_dumps(dumps, solr_url)
1✔
UNCOV
29
    solr = rsolr_connection(solr_url)
×
UNCOV
30
    return if solr.nil?
×
31

UNCOV
32
    dumps.each do |dump|
×
UNCOV
33
      dump.dump_files.each do |df|
×
UNCOV
34
        next unless df.recap_record_type?
×
35

UNCOV
36
        Index::DumpFileJob.perform_async(df.id, solr_url)
×
37
      end
UNCOV
38
      solr.delete_by_id(dump.delete_ids) if dump.delete_ids.present?
×
39
    end
40
  end
41
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