From 5c68e32abb5369809ba941c89142a273ffa8ab8d Mon Sep 17 00:00:00 2001 From: Mark Beamer Jr Date: Sun, 22 Sep 2019 01:56:36 -0400 Subject: [PATCH] Strip @ prefix subquery Signed-off-by: Mark Beamer Jr --- server/controllers/lighthouse.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/controllers/lighthouse.js b/server/controllers/lighthouse.js index 97c2262..b549119 100644 --- a/server/controllers/lighthouse.js +++ b/server/controllers/lighthouse.js @@ -98,6 +98,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 = []; @@ -271,6 +279,7 @@ function getResults (input) { conBoost, funcScoreClaimWeight, funcScoreChannelWeight, + channelIdentifier, ], 'must': [ ...dynamicFilters(),