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.3.2 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.3.1 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.3.0 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.2.0 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.1.2 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.1.1 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.1.0 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.0.0 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.0.0.beta10 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.0.0.beta9 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.0.0.beta8 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.0.0.beta7 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.0.0.beta6 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.0.0.beta5 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.0.0.beta4 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.0.0.beta3 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.0.0.beta2 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-1.0.0.beta1 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-0.14.0 app/search_builders/curation_concerns/lease_search_builder.rb
curation_concerns-0.14.0.pre4 app/search_builders/curation_concerns/lease_search_builder.rb