From 8801cfd213c44153cae45b2fe65ad0088c9b42f7 Mon Sep 17 00:00:00 2001
From: Mark Beamer Jr <markbeamerjr@gmail.com>
Date: Thu, 8 Nov 2018 09:21:32 -0500
Subject: [PATCH 1/2] fixed pull_request typo.

---
 server/controllers/lighthouse.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/controllers/lighthouse.js b/server/controllers/lighthouse.js
index 5c3fd4c..b715c5a 100644
--- a/server/controllers/lighthouse.js
+++ b/server/controllers/lighthouse.js
@@ -448,7 +448,7 @@ class LighthouseControllers {
     if (status) {
       let notification = JSON.parse(payload);
       if (notification.branch === 'master') {
-        if (!notification.isPullRequest) {
+        if (!notification.pull_request) {
           logToSlack('Auto Updating Lighthouse - ' + notification.message);
           update();
           ctx.body = 'OK';
-- 
2.49.1


From 258c378188f4fc39e9aa4ba821a495e2f56068e3 Mon Sep 17 00:00:00 2001
From: Mark Beamer Jr <markbeamerjr@gmail.com>
Date: Wed, 9 Jan 2019 20:42:30 -0500
Subject: [PATCH 2/2] added removal from query `lbry://` ( lbry urls )

---
 server/controllers/lighthouse.js | 15 +++++++++++++--
 server/utils/chainquery/index.js |  1 +
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/server/controllers/lighthouse.js b/server/controllers/lighthouse.js
index 6eb8578..da8190e 100644
--- a/server/controllers/lighthouse.js
+++ b/server/controllers/lighthouse.js
@@ -63,7 +63,7 @@ function getResults (input) {
       },
     },
   };
-  const funcScore = { // 100 LBC adds 1 point to the score
+  const funcScoreClaimWeight = { // 100 LBC adds 1 point to the score
     'function_score': {
       'script_score': {
         'script': {
@@ -72,6 +72,16 @@ function getResults (input) {
       },
     },
   };
+
+  const funcScoreChannelWeight = { // 100 LBC adds 1 point to the score
+    'function_score': {
+      'script_score': {
+        'script': {
+          'source': `${effectiveFactor} * doc['certificate_amount'].value`,
+        },
+      },
+    },
+  };
   const matPhraseName = { // Match search text as phrase - Name
     'match_phrase': {
       'name': {
@@ -176,7 +186,8 @@ function getResults (input) {
         'bool': {
           'should': [
             conBoost,
-            funcScore,
+            funcScoreClaimWeight,
+            funcScoreChannelWeight,
           ],
           'must': [
             channelSearch,
diff --git a/server/utils/chainquery/index.js b/server/utils/chainquery/index.js
index b570968..fbe0027 100644
--- a/server/utils/chainquery/index.js
+++ b/server/utils/chainquery/index.js
@@ -161,6 +161,7 @@ function getClaimsSince (time) {
       `SELECT ` +
       `c.name,` +
       `p.name as channel,` +
+      `p.effective_amount as certificate_amount` +
       `c.bid_state,` +
       `c.effective_amount,` +
       `c.claim_id as claimId,` +
-- 
2.49.1