Sha256: 266ef29a6c25c8904e19cd6c970eafa6451423813f47c7d23b7857cdc4949d2b
Contents?: true
Size: 934 Bytes
Versions: 10
Compression:
Stored size: 934 Bytes
Contents
module Hyrax # Finds the child objects contained within a collection class MemberWithFilesSearchBuilder < ::SearchBuilder class_attribute :from_field self.from_field = 'child_object_ids_ssim' self.default_processor_chain += [:include_collection_ids, :include_contained_files] # This is like include_collection_ids, but it also joins the files. def include_contained_files(solr_parameters) solr_parameters[:fq] ||= [] solr_parameters[:fq] << "{!join from=file_set_ids_ssim to=id}{!join from=child_object_ids_ssim to=id}id:#{collection_id}" end # 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
10 entries across 10 versions & 2 rubygems