Sha256: 0b9714f1470b71bd23ec6137ff9b6eeba3d7cffab68d21b24b525e43c2d2a049

Contents?: true

Size: 566 Bytes

Versions: 11

Compression:

Stored size: 566 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:[* TO *]'
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
hyrax-2.9.6 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.9.5 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.9.4 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.9.3 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.9.2 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.9.1 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.9.0 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-2.8.0 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-3.0.0.pre.rc1 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-3.0.0.pre.beta3 app/search_builders/hyrax/embargo_search_builder.rb
hyrax-3.0.0.pre.beta2 app/search_builders/hyrax/embargo_search_builder.rb