Sha256: 9ac2bdee89930d6a08ddb598428abb6b0b43b35c44769421dd78e8694c4035fb

Contents?: true

Size: 556 Bytes

Versions: 24

Compression:

Stored size: 556 Bytes

Contents

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

    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

24 entries across 24 versions & 1 rubygems

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