diff --git a/app/parsers/bulkrax/parser_export_record_set.rb b/app/parsers/bulkrax/parser_export_record_set.rb index 3e57a34d5..4b68f90ec 100644 --- a/app/parsers/bulkrax/parser_export_record_set.rb +++ b/app/parsers/bulkrax/parser_export_record_set.rb @@ -149,12 +149,12 @@ def extra_filters end def works - @works ||= ActiveFedora::SolrService.query(works_query, **works_query_kwargs) + @works ||= Bulkrax.persistence_adapter.query(works_query, **works_query_kwargs) end def collections @collections ||= if collections_query - ActiveFedora::SolrService.query(collections_query, **collections_query_kwargs) + Bulkrax.persistence_adapter.query(collections_query, **collections_query_kwargs) else [] end @@ -175,7 +175,7 @@ def file_sets @file_sets ||= ParserExportRecordSet.in_batches(candidate_file_set_ids) do |batch_of_ids| fsq = "has_model_ssim:#{Bulkrax.file_model_class} AND id:(\"" + batch_of_ids.join('" OR "') + "\")" fsq += extra_filters if extra_filters.present? - ActiveFedora::SolrService.query( + Bulkrax.persistence_adapter.query( fsq, { fl: "id", method: :post, rows: batch_of_ids.size } ) @@ -247,7 +247,7 @@ def complete_entry_identifiers def works @works ||= ParserExportRecordSet.in_batches(complete_entry_identifiers) do |ids| - ActiveFedora::SolrService.query( + Bulkrax.persistence_adapter.query( extra_filters.to_s, **query_kwargs.merge( fq: [ @@ -262,7 +262,7 @@ def works def collections @collections ||= ParserExportRecordSet.in_batches(complete_entry_identifiers) do |ids| - ActiveFedora::SolrService.query( + Bulkrax.persistence_adapter.query( "has_model_ssim:Collection #{extra_filters}", **query_kwargs.merge( fq: [ @@ -281,7 +281,7 @@ def collections # @see Bulkrax::ParserExportRecordSet::Base#file_sets def file_sets @file_sets ||= ParserExportRecordSet.in_batches(complete_entry_identifiers) do |ids| - ActiveFedora::SolrService.query( + Bulkrax.persistence_adapter.query( extra_filters, query_kwargs.merge( fq: [ diff --git a/spec/parsers/bulkrax/bagit_parser_spec.rb b/spec/parsers/bulkrax/bagit_parser_spec.rb index 4ca1ae265..3877b4646 100644 --- a/spec/parsers/bulkrax/bagit_parser_spec.rb +++ b/spec/parsers/bulkrax/bagit_parser_spec.rb @@ -288,7 +288,7 @@ module Bulkrax let(:fileset_entry_2) { FactoryBot.create(:bulkrax_csv_entry_file_set, importerexporter: exporter) } before do - allow(ActiveFedora::SolrService).to receive(:query).and_return(work_ids_solr) + allow(Bulkrax.persistence_adapter).to receive(:query).and_return(work_ids_solr) allow(exporter.entries).to receive(:where).and_return([work_entry_1, work_entry_2, fileset_entry_1, fileset_entry_2]) end diff --git a/spec/parsers/bulkrax/csv_parser_spec.rb b/spec/parsers/bulkrax/csv_parser_spec.rb index 58fb7d44a..eb0e47252 100644 --- a/spec/parsers/bulkrax/csv_parser_spec.rb +++ b/spec/parsers/bulkrax/csv_parser_spec.rb @@ -633,7 +633,7 @@ module Bulkrax end before do - allow(ActiveFedora::SolrService).to receive(:query).and_return(SolrDocument.new(id: work_id)) + allow(Bulkrax.persistence_adapter).to receive(:query).and_return(SolrDocument.new(id: work_id)) allow(exporter.entries).to receive(:where).and_return([entry]) allow(parser).to receive(:headers).and_return(entry.parsed_metadata.keys) end