Sha256: 10cb2edb172241f34dcfa1fb313977eb99b1e92ec1b38ffff7f6444336e46a91

Contents?: true

Size: 517 Bytes

Versions: 25

Compression:

Stored size: 517 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  # Given the id of a work, find the collections it is a member of
  class ParentCollectionSearchBuilder < Hyrax::CollectionSearchBuilder
    delegate :item, to: :scope

    # include filters into the query to only include the collections containing this item
    def include_item_ids(solr_parameters)
      solr_parameters[:fq] ||= []
      solr_parameters[:fq] += [Hyrax::SolrQueryBuilderService.construct_query_for_ids([item.member_of_collection_ids])]
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
hyrax-5.0.1 app/search_builders/hyrax/parent_collection_search_builder.rb
hyrax-5.0.0 app/search_builders/hyrax/parent_collection_search_builder.rb
hyrax-5.0.0.rc3 app/search_builders/hyrax/parent_collection_search_builder.rb
hyrax-5.0.0.rc2 app/search_builders/hyrax/parent_collection_search_builder.rb
hyrax-5.0.0.rc1 app/search_builders/hyrax/parent_collection_search_builder.rb
hyrax-3.6.0 app/search_builders/hyrax/parent_collection_search_builder.rb
hyrax-4.0.0 app/search_builders/hyrax/parent_collection_search_builder.rb
hyrax-4.0.0.rc3 app/search_builders/hyrax/parent_collection_search_builder.rb
hyrax-4.0.0.rc2 app/search_builders/hyrax/parent_collection_search_builder.rb
hyrax-4.0.0.rc1 app/search_builders/hyrax/parent_collection_search_builder.rb
hyrax-3.5.0 app/search_builders/hyrax/parent_collection_search_builder.rb
hyrax-4.0.0.beta2 app/search_builders/hyrax/parent_collection_search_builder.rb
hyrax-3.4.2 app/search_builders/hyrax/parent_collection_search_builder.rb
hyrax-4.0.0.beta1 app/search_builders/hyrax/parent_collection_search_builder.rb
hyrax-3.4.1 app/search_builders/hyrax/parent_collection_search_builder.rb
hyrax-3.4.0 app/search_builders/hyrax/parent_collection_search_builder.rb
hyrax-3.3.0 app/search_builders/hyrax/parent_collection_search_builder.rb
hyrax-3.2.0 app/search_builders/hyrax/parent_collection_search_builder.rb
hyrax-3.1.0 app/search_builders/hyrax/parent_collection_search_builder.rb
hyrax-3.0.2 app/search_builders/hyrax/parent_collection_search_builder.rb