Sha256: 37cbe9b9614750819210d3f442c278813cd7606decc491cf1e8f57d680d3f5c6

Contents?: true

Size: 559 Bytes

Versions: 47

Compression:

Stored size: 559 Bytes

Contents

module Hyrax
  # Finds embargoed objects
  class EmbargoSearchBuilder < Blacklight::SearchBuilder
    self.default_processor_chain = [:with_pagination, :with_sorting, :only_active_embargoes]

    # TODO: add more complex pagination
    def with_pagination(solr_params)
      solr_params[:rows] = 1000
    end

    def with_sorting(solr_params)
      solr_params[:sort] = 'embargo_release_date_dtsi desc'
    end

    def only_active_embargoes(solr_params)
      solr_params[:fq] ||= []
      solr_params[:fq] = 'embargo_release_date_dtsi:*'
    end
  end
end

Version data entries

47 entries across 47 versions & 2 rubygems

Version Path
hyrax-2.7.2 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.7.1 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.7.0 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.6.0 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.5.1 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.5.0 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.4.1 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-3.0.0.pre.beta1 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.4.0 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.3.3 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.3.2 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.3.1 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-1.1.1 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.3.0 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.0.3 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.2.4 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.2.3 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.2.2 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.2.1 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.2.0 app/search_builders/hyrax/embargo_search_builder.rb