Sha256: 3dfcfdf2f79d3b9268098720a230718944105ca1a1c064b4dae06349a9f5220a

Contents?: true

Size: 648 Bytes

Versions: 14

Compression:

Stored size: 648 Bytes

Contents

module CurationConcerns
  class MemberSearchBuilder < ::SearchBuilder
    class_attribute :from_field
    self.from_field = 'member_ids_ssim'

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

    # include filters into the query to only include the collection memebers
    def include_collection_ids(solr_parameters)
      solr_parameters[:fq] ||= []
      solr_parameters[:fq] << "{!join from=#{from_field} to=id}id:#{collection_id}"
    end

    protected

      def collection_id
        blacklight_params.fetch('id')
      end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 app/search_builders/curation_concerns/member_search_builder.rb
curation_concerns-1.7.7 app/search_builders/curation_concerns/member_search_builder.rb
curation_concerns-1.7.6 app/search_builders/curation_concerns/member_search_builder.rb
curation_concerns-1.7.5 app/search_builders/curation_concerns/member_search_builder.rb
curation_concerns-1.7.4 app/search_builders/curation_concerns/member_search_builder.rb
curation_concerns-1.7.3 app/search_builders/curation_concerns/member_search_builder.rb
curation_concerns-1.7.2 app/search_builders/curation_concerns/member_search_builder.rb
curation_concerns-1.7.1 app/search_builders/curation_concerns/member_search_builder.rb
curation_concerns-1.7.0 app/search_builders/curation_concerns/member_search_builder.rb
curation_concerns-1.7.0.beta1 app/search_builders/curation_concerns/member_search_builder.rb
curation_concerns-1.6.3 app/search_builders/curation_concerns/member_search_builder.rb
curation_concerns-1.6.2 app/search_builders/curation_concerns/member_search_builder.rb
curation_concerns-1.6.1 app/search_builders/curation_concerns/member_search_builder.rb
curation_concerns-1.6.0 app/search_builders/curation_concerns/member_search_builder.rb