trimmed whitespace for search terms.

This commit is contained in:
Mark Beamer Jr 2018-09-15 21:39:51 -04:00
parent 59675a89ec
commit ad533e3989
No known key found for this signature in database
GPG key ID: 1C314FB89AD76973

View file

@ -42,7 +42,7 @@ function getResults (input) {
'must': { 'must': {
'query_string': { 'query_string': {
'fields': ['channel'], 'fields': ['channel'],
'query' : getEscapedQuery(input.channel), 'query' : getEscapedQuery(input.channel.trim()),
}, },
}, },
}, },
@ -83,7 +83,7 @@ function getResults (input) {
}; };
const conTermName = { // Contains search term - Name const conTermName = { // Contains search term - Name
'query_string': { 'query_string': {
'query' : '*' + getEscapedQuery(input.s) + '*', 'query' : '*' + getEscapedQuery(input.s.trim()) + '*',
'fields': [ 'fields': [
'name', 'name',
], ],
@ -98,7 +98,7 @@ function getResults (input) {
'should': [ 'should': [
{ // Contains search term in Author, Title, Description { // Contains search term in Author, Title, Description
'query_string': { 'query_string': {
'query' : '*' + getEscapedQuery(input.s) + '*', 'query' : '*' + getEscapedQuery(input.s.trim()) + '*',
'fields': [ 'fields': [
'value.stream.metadata.author', 'value.stream.metadata.author',
'value.stream.metadata.title', 'value.stream.metadata.title',