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:

  • Typically (scope)

    the controller object

  • (Collection)

12
13
14
15
# File 'app/search_builders/hyrax/admin_admin_set_member_search_builder.rb', line 12

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

Instance Attribute Details

#collectionObject (readonly)

Returns the value of attribute collection


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

def collection
  @collection
end

Instance Method Details

#in_admin_set(solr_parameters) ⇒ Object

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


18
19
20
21
# File 'app/search_builders/hyrax/admin_admin_set_member_search_builder.rb', line 18

def in_admin_set(solr_parameters)
  solr_parameters[:fq] ||= []
  solr_parameters[:fq] << "{!term f=isPartOf_ssim}#{collection.id}"
end