Merge pull request #114 from lbryio/trim_white_space

Trim white space
This commit is contained in:
Mark 2018-09-23 10:35:37 -04:00 committed by GitHub
commit 6d52314f16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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',