Skip to content

Commit

Permalink
Index admin_sets using the configured predicate
Browse files Browse the repository at this point in the history
Fixes #2405.
Connected to #1461
  • Loading branch information
Tom Johnson committed Sep 21, 2019
1 parent 81b9d58 commit 7014809
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def initialize(scope:, collection:)
# include filters into the query to only include the admin_set members (regardless of status)
def in_admin_set(solr_parameters)
solr_parameters[:fq] ||= []
solr_parameters[:fq] << "{!term f=isPartOf_ssim}#{collection.id}"
solr_parameters[:fq] << "{!term f=#{Hyrax.config.admin_set_predicate.qname.last}_ssim}#{collection.id}"
end
end
end
2 changes: 1 addition & 1 deletion app/services/hyrax/admin_set_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def search_results(access)
# @param [Symbol] access :read or :edit
# @param join_field [String] how are we joining the admin_set ids (by default "isPartOf_ssim")
# @return [Array<Hyrax::AdminSetService::SearchResultForWorkCount>] a list with document, then work and file count
def search_results_with_work_count(access, join_field: "isPartOf_ssim")
def search_results_with_work_count(access, join_field: "#{Hyrax.config.admin_set_predicate.qname.last}_ssim")
admin_sets = search_results(access)
ids = admin_sets.map(&:id).join(',')
query = "{!terms f=#{join_field}}#{ids}"
Expand Down

0 comments on commit 7014809

Please sign in to comment.