Class: Hyrax::AdminAdminSetMemberSearchBuilder

Inherits:
SearchBuilder
  • Object
show all
Defined in:
app/search_builders/hyrax/admin_admin_set_member_search_builder.rb

Overview

Builds a query to find the members of an admin set. For use on the admin menu, so it includes works regardless of status.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope:, collection:) ⇒ AdminAdminSetMemberSearchBuilder

Returns a new instance of AdminAdminSetMemberSearchBuilder.

Parameters:

  • scope (Object)

    Typically the controller object

  • collection (::Collection)

14
15
16
17
# File 'app/search_builders/hyrax/admin_admin_set_member_search_builder.rb', line 14

def initialize(scope:, collection:)
  @collection = collection
  super(scope)
end

Instance Attribute Details

#collectionObject (readonly)

Returns the value of attribute collection


9
10
11
# File 'app/search_builders/hyrax/admin_admin_set_member_search_builder.rb', line 9

def collection
  @collection
end

Instance Method Details

#in_admin_set(solr_parameters) ⇒ void

This method returns an undefined value.

include filters into the query to only include the admin_set members (regardless of status)

Parameters:

  • solr_parameters (Hash)

25
26
27
28
# File 'app/search_builders/hyrax/admin_admin_set_member_search_builder.rb', line 25

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