From e7c97e8420ba7141893fa32d85f74851d291574a Mon Sep 17 00:00:00 2001
From: Mark Beamer Jr <markbeamerjr@gmail.com>
Date: Sun, 22 Sep 2019 01:56:36 -0400
Subject: [PATCH] Strip @ prefix subquery

Signed-off-by: Mark Beamer Jr <markbeamerjr@gmail.com>
---
 server/controllers/lighthouse.js | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/server/controllers/lighthouse.js b/server/controllers/lighthouse.js
index 15cf059..d564184 100644
--- a/server/controllers/lighthouse.js
+++ b/server/controllers/lighthouse.js
@@ -80,6 +80,14 @@ function getResults (input) {
       },
     },
   };
+  // Try prefix query without an @ if it exists
+  const channelIdentifier = {
+    'prefix': {
+      'name': {
+        'value': escapedQuery.replace(/^@/gi, ''), 'boost': 50,
+      },
+    },
+  };
 
   const splitName = () => {
     let queries = [];
@@ -253,6 +261,7 @@ function getResults (input) {
             conBoost,
             funcScoreClaimWeight,
             funcScoreChannelWeight,
+            channelIdentifier,
           ],
           'must': [
             channelSearch,