Module: Hyrax::V2GraphIndexer::NestedCollectionsSearchBuilderDecorator

Defined in:
lib/hyrax/v2_graph_indexer.rb

Overview

Note:

from github.com/samvera/hyrax/pull/5858/ with modifications based on v2.9.6 of Hyrax.

Instance Method Summary collapse

Instance Method Details

#show_only_other_collections_of_the_same_collection_type(solr_parameters) ⇒ Object

rubocop:disable Metrics/LineLength



97
98
99
100
101
102
103
104
# File 'lib/hyrax/v2_graph_indexer.rb', line 97

def show_only_other_collections_of_the_same_collection_type(solr_parameters)
  solr_parameters[:fq] ||= []
  solr_parameters[:fq] += [
    ActiveFedora::SolrQueryBuilder.construct_query(Collection.collection_type_gid_document_field_name => @collection.collection_type_gid),
    "-{!graph from=id to=member_of_collection_ids_ssim#{' maxDepth=1' if @nest_direction == :as_parent}}id:#{@collection.id}",
    "-{!graph to=id from=member_of_collection_ids_ssim#{' maxDepth=1' if @nest_direction == :as_child}}id:#{@collection.id}"
  ]
end