Sha256: 21c3f4355abbcf5a69fbde67906272ac09d6adb943eed099e2bdf6bc255caefc

Contents?: true

Size: 950 Bytes

Versions: 28

Compression:

Stored size: 950 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  # Builds a query to find the members of an admin set.
  # For use on the admin menu, so it includes works regardless of status.
  class AdminAdminSetMemberSearchBuilder < ::SearchBuilder
    self.default_processor_chain += [:in_admin_set]
    self.default_processor_chain -= [:only_active_works]

    attr_reader :collection

    ##
    # @param [Object] scope Typically the controller object
    # @param [::Collection] collection
    def initialize(scope:, collection:)
      @collection = collection
      super(scope)
    end

    ##
    # include filters into the query to only include the admin_set members (regardless of status)
    #
    # @param [Hash] solr_parameters
    #
    # @return [void]
    def in_admin_set(solr_parameters)
      solr_parameters[:fq] ||= []
      solr_parameters[:fq] << "{!term f=#{Hyrax.config.admin_set_predicate.qname.last}_ssim}#{collection.id}"
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
hyrax-5.1.0.pre.beta1 app/search_builders/hyrax/admin_admin_set_member_search_builder.rb
hyrax-5.0.4 app/search_builders/hyrax/admin_admin_set_member_search_builder.rb
hyrax-5.0.3 app/search_builders/hyrax/admin_admin_set_member_search_builder.rb
hyrax-5.0.2 app/search_builders/hyrax/admin_admin_set_member_search_builder.rb
hyrax-5.0.1 app/search_builders/hyrax/admin_admin_set_member_search_builder.rb
hyrax-5.0.0 app/search_builders/hyrax/admin_admin_set_member_search_builder.rb
hyrax-5.0.0.rc3 app/search_builders/hyrax/admin_admin_set_member_search_builder.rb
hyrax-5.0.0.rc2 app/search_builders/hyrax/admin_admin_set_member_search_builder.rb
hyrax-5.0.0.rc1 app/search_builders/hyrax/admin_admin_set_member_search_builder.rb
hyrax-3.6.0 app/search_builders/hyrax/admin_admin_set_member_search_builder.rb
hyrax-4.0.0 app/search_builders/hyrax/admin_admin_set_member_search_builder.rb
hyrax-4.0.0.rc3 app/search_builders/hyrax/admin_admin_set_member_search_builder.rb
hyrax-4.0.0.rc2 app/search_builders/hyrax/admin_admin_set_member_search_builder.rb
hyrax-4.0.0.rc1 app/search_builders/hyrax/admin_admin_set_member_search_builder.rb
hyrax-3.5.0 app/search_builders/hyrax/admin_admin_set_member_search_builder.rb
hyrax-4.0.0.beta2 app/search_builders/hyrax/admin_admin_set_member_search_builder.rb
hyrax-3.4.2 app/search_builders/hyrax/admin_admin_set_member_search_builder.rb
hyrax-4.0.0.beta1 app/search_builders/hyrax/admin_admin_set_member_search_builder.rb
hyrax-3.4.1 app/search_builders/hyrax/admin_admin_set_member_search_builder.rb
hyrax-3.4.0 app/search_builders/hyrax/admin_admin_set_member_search_builder.rb