From ad533e3989cc48e0b0b19f4123a9b9ac00c4556d Mon Sep 17 00:00:00 2001 From: Mark Beamer Jr Date: Sat, 15 Sep 2018 21:39:51 -0400 Subject: [PATCH] trimmed whitespace for search terms. --- server/controllers/lighthouse.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/controllers/lighthouse.js b/server/controllers/lighthouse.js index e33fca7..09ff375 100644 --- a/server/controllers/lighthouse.js +++ b/server/controllers/lighthouse.js @@ -42,7 +42,7 @@ function getResults (input) { 'must': { 'query_string': { 'fields': ['channel'], - 'query' : getEscapedQuery(input.channel), + 'query' : getEscapedQuery(input.channel.trim()), }, }, }, @@ -83,7 +83,7 @@ function getResults (input) { }; const conTermName = { // Contains search term - Name 'query_string': { - 'query' : '*' + getEscapedQuery(input.s) + '*', + 'query' : '*' + getEscapedQuery(input.s.trim()) + '*', 'fields': [ 'name', ], @@ -98,7 +98,7 @@ function getResults (input) { 'should': [ { // Contains search term in Author, Title, Description 'query_string': { - 'query' : '*' + getEscapedQuery(input.s) + '*', + 'query' : '*' + getEscapedQuery(input.s.trim()) + '*', 'fields': [ 'value.stream.metadata.author', 'value.stream.metadata.title',