Sha256: 978584399b33f05c9fce900fc01cea09e95cb3fdbcacbc67b0cb14e380b954a9

Contents?: true

Size: 670 Bytes

Versions: 10

Compression:

Stored size: 670 Bytes

Contents

module Hyrax
  class CollectionMemberSearchBuilder < ::SearchBuilder
    include Hyrax::FilterByType

    class_attribute :collection_membership_field
    self.collection_membership_field = 'member_of_collection_ids_ssim'

    # Defines which search_params_logic should be used when searching for Collection members
    self.default_processor_chain += [:member_of_collection]

    delegate :collection, to: :scope

    # include filters into the query to only include the collection memebers
    def member_of_collection(solr_parameters)
      solr_parameters[:fq] ||= []
      solr_parameters[:fq] << "#{collection_membership_field}:#{collection.id}"
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
hyrax-1.1.1 app/search_builders/hyrax/collection_member_search_builder.rb
hyrax-1.1.0 app/search_builders/hyrax/collection_member_search_builder.rb
hyrax-1.0.5 app/search_builders/hyrax/collection_member_search_builder.rb
hyrax-1.0.4 app/search_builders/hyrax/collection_member_search_builder.rb
hyrax-1.0.3 app/search_builders/hyrax/collection_member_search_builder.rb
hyrax-1.0.2 app/search_builders/hyrax/collection_member_search_builder.rb
hyrax-1.0.1 app/search_builders/hyrax/collection_member_search_builder.rb
hyrax-1.0.0.rc2 app/search_builders/hyrax/collection_member_search_builder.rb
hyrax-1.0.0.rc1 app/search_builders/hyrax/collection_member_search_builder.rb
test_hyrax-0.0.1.alpha app/search_builders/hyrax/collection_member_search_builder.rb