Class: Hyrax::MemberWithFilesSearchBuilder

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

Overview

Finds the child objects contained within a collection

Instance Method Summary collapse

Instance Method Details

#include_collection_ids(solr_parameters) ⇒ Object

include filters into the query to only include the collection memebers



16
17
18
19
# File 'app/search_builders/hyrax/member_with_files_search_builder.rb', line 16

def include_collection_ids(solr_parameters)
  solr_parameters[:fq] ||= []
  solr_parameters[:fq] << "{!join from=#{from_field} to=id}id:#{collection_id}"
end

#include_contained_files(solr_parameters) ⇒ Object

This is like include_collection_ids, but it also joins the files.



10
11
12
13
# File 'app/search_builders/hyrax/member_with_files_search_builder.rb', line 10

def include_contained_files(solr_parameters)
  solr_parameters[:fq] ||= []
  solr_parameters[:fq] << "{!join from=member_ids_ssim to=id}{!join from=child_object_ids_ssim to=id}id:#{collection_id}"
end