From af4329b9e7501de9e744fed047a0bc44d0892779 Mon Sep 17 00:00:00 2001
From: Mark Beamer Jr <markbeamerjr@gmail.com>
Date: Mon, 12 Nov 2018 21:33:18 -0500
Subject: [PATCH] Added multi character splits to split by `&`, ` `, and `$`

---
 server/controllers/lighthouse.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/server/controllers/lighthouse.js b/server/controllers/lighthouse.js
index b715c5a..81bd4ae 100644
--- a/server/controllers/lighthouse.js
+++ b/server/controllers/lighthouse.js
@@ -318,8 +318,10 @@ function getStatus () {
 function getWashedQuery (query) {
   // compress multiple white spaces to 1
   query = query.toLowerCase().replace(/ +/g, ' ');
+  let splitBy = ['&', '$', ' '];
+  let regex = new RegExp(splitBy.join('|'), 'gi');
   let badWords  = [ 'from', 'with', 'not', 'can', 'all', 'are', 'for', 'but', 'and', 'the' ];
-  let words = query.split(' ');
+  let words = query.split(regex);
   let sentence = [];
   words.forEach(w => {
     if (!badWords.includes(w))      { sentence.push(w) }