From cad65fc5ca1955606470c496aa5d6b184858353b Mon Sep 17 00:00:00 2001 From: Michael Gibney Date: Thu, 11 Jun 2020 16:36:34 -0400 Subject: [PATCH] restore lambdas for subject specialists post-rebase --- app/controllers/catalog_controller.rb | 9 +++++++++ 1 file changed, 9 insertions(+) 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) }