Sha256: 86bc7fbcc25ffa651fc679788ba99eabac421a8c82aad13ad06683105ec5ea2a

Contents?: true

Size: 566 Bytes

Versions: 62

Compression:

Stored size: 566 Bytes

Contents

module CurationConcerns
  # Finds objects under lease
  class LeaseSearchBuilder < Blacklight::SearchBuilder
    self.default_processor_chain = [:with_pagination, :with_sorting, :only_active_leases]

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

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

    def only_active_leases(solr_params)
      solr_params[:fq] ||= []
      solr_params[:fq] = 'lease_expiration_date_dtsi:*'
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.7.7 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-2.0.0 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-2.0.0.rc2 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.7.6 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.7.5 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.7.4 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.7.3 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.7.2 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-2.0.0.rc1 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.7.1 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.7.0 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.7.0.beta1 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.6.3 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.6.2 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.6.1 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.6.0 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.5.0 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.4.0 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.3.3 app/search_builders/curation_concerns/lease_search_builder.rb