From a6d9b9db5e870c8a26aa1ed46e77ca20d4144fa4 Mon Sep 17 00:00:00 2001 From: Monique Rio Date: Wed, 15 Nov 2023 12:19:15 -0500 Subject: [PATCH] made author and subject independent --- .gitignore | 1 + env.example | 3 ++- lib/models/author_list.rb | 2 +- lib/services.rb | 4 ++++ spec/spec_helper.rb | 1 + 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 37db4f1..7aa4caa 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ node_modules/ public/browse.css .bash_history .cache/ +.solargraph.yml diff --git a/env.example b/env.example index 2910fcb..260c22e 100644 --- a/env.example +++ b/env.example @@ -2,7 +2,8 @@ BIBLIO_SOLR='http://biblio-server/solr' AUTHOR_SOLR='http://catalog-solr-server/solr' BROWSE_SOLR='http://catalog-solr-server/solr' CALLNUMBER_CORE='callnumbers' -AUTHORITY_CORE='authors' +AUTHORITY_CORE='authority_core' +AUTHOR_COLLECTION='author_collection' SOLR_USER='solr' SOLR_PASSWORD='SolrRocks' SOLR_CLOUD_ON='false' diff --git a/lib/models/author_list.rb b/lib/models/author_list.rb index bddb652..07a640a 100644 --- a/lib/models/author_list.rb +++ b/lib/models/author_list.rb @@ -6,7 +6,7 @@ def self.for(direction:, reference_id:, num_rows_to_display:, original_reference num_rows_to_display: num_rows_to_display, original_reference: original_reference, banner_reference: banner_reference, - browse_solr_client: BrowseSolrClient.new(solr_url: S.author_solr, core: S.authority_core, match_field: "term", q: "browse_field:name", solr_cloud_on: S.solr_cloud_on?) + browse_solr_client: BrowseSolrClient.new(solr_url: S.author_solr, core: S.author_collection, match_field: "term", q: "browse_field:name", solr_cloud_on: S.solr_cloud_on?) ) new(browse_list: browse_list) diff --git a/lib/services.rb b/lib/services.rb index 832f477..f899c1b 100644 --- a/lib/services.rb +++ b/lib/services.rb @@ -11,6 +11,10 @@ ENV["AUTHOR_SOLR"] || ENV["BROWSE_SOLR"] end +S.register(:author_collection) do + ENV["AUTHOR_COLLECTION"] || ENV["AUTHORITY_CORE"] +end + [ "BROWSE_SOLR", "BIBLIO_SOLR", "SOLR_USER", "SOLR_PASSWORD", "CALLNUMBER_CORE", "AUTHORITY_CORE" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 98f72ef..73b6bf0 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -29,6 +29,7 @@ def app = Sinatra::Application # set up dependencies S.register(:author_solr) { S.browse_solr } +S.register(:author_collection) { S.authority_core } S.register(:solr_cloud_on?) { false } RSpec.configure do |config|