Sha256: 01f34bb2741efb551385c67e02d96a8d4e1fbb6821e4c72aabcc33fd44a9596b

Contents?: true

Size: 621 Bytes

Versions: 5

Compression:

Stored size: 621 Bytes

Contents

module Sufia
  module Catalog
    extend ActiveSupport::Concern
    included do
      self.solr_search_params_logic += [:only_generic_files_and_collections]
    end

    protected

      # Limits search results just to GenericFiles and collections
      # @param solr_parameters the current solr parameters
      # @param user_parameters the current user-subitted parameters
      def only_generic_files_and_collections(solr_parameters, user_parameters)
        solr_parameters[:fq] ||= []
        solr_parameters[:fq] << "#{Solrizer.solr_name("has_model", :symbol)}:(\"GenericFile\" \"Collection\")"
      end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sufia-6.0.0.rc4 app/controllers/concerns/sufia/catalog.rb
sufia-6.0.0.rc3 app/controllers/concerns/sufia/catalog.rb
sufia-6.0.0.rc2 app/controllers/concerns/sufia/catalog.rb
sufia-6.0.0.rc1 app/controllers/concerns/sufia/catalog.rb
sufia-6.0.0.beta1 app/controllers/concerns/sufia/catalog.rb