diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index 46f1da1f..30f33787 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -235,6 +235,15 @@ def self.generate_cluster_fq(index, limit, elvl = false) a.params.dig(:f, :format_f)&.include?('Database & Article Index') } + get_hits = lambda { |v| + r1 = v[:r1] + r1.nil? ? 0 : (r1[:relatedness].to_f * 100000).to_i + } + + post_sort = lambda { |items| + items.sort { |a,b| b.hits <=> a.hits } + } + local_only = lambda { |a, b, c| 'Include Partner Libraries' != a.params.dig(:f, :cluster, 0) }