Skip to content

Commit

Permalink
count collection items with the SolrService directly
Browse files Browse the repository at this point in the history
remove a hard dependency on ActiveFedora by querying solr directly instead of
using the `Relation#count` interface.

there are other methods here using similar queries, but working out the
relationship with `Blacklight::AccessControls::Enforcement` is going to take
some more work. for one thing, we have local `Enforcement` additions that are
being bypassed (inappropriately?) by the existing queries.
  • Loading branch information
tom johnson authored and Tom Johnson committed May 18, 2020
1 parent 0ea70f2 commit e3efa1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/presenters/hyrax/collection_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def size
end

def total_items
ActiveFedora::Base.where("member_of_collection_ids_ssim:#{id}").count
Hyrax::SolrService.new.count("member_of_collection_ids_ssim:#{id}")
end

def total_viewable_items
Expand Down

0 comments on commit e3efa1e

Please sign in to comment.