Removed permanent wash to avoid exact match queries from failing.

This commit is contained in:
Mark Beamer Jr 2019-07-12 20:22:52 -04:00
parent 7ac9900158
commit 127155ef16
No known key found for this signature in database
GPG key ID: 1C314FB89AD76973

View file

@ -38,8 +38,8 @@ function getResults (input) {
input.from = 10000 - input.size; input.from = 10000 - input.size;
} }
let trimmedQuery = input.s.trim(); let trimmedQuery = input.s.trim();
let escapedQuery = getWashedQuery(getEscapedQuery(trimmedQuery)); let escapedQuery = getEscapedQuery(trimmedQuery);
let washedQuery = getWashedQuery(trimmedQuery); let washedQuery = getEscapedQuery(getWashedQuery(trimmedQuery));
let effectiveFactor = '0.00000000001'; let effectiveFactor = '0.00000000001';
// Search is split up into different parts, all search parts goes under this line. // Search is split up into different parts, all search parts goes under this line.
let channelSearch; let channelSearch;
@ -49,7 +49,7 @@ function getResults (input) {
'must': { 'must': {
'query_string': { 'query_string': {
'fields': ['channel'], 'fields': ['channel'],
'query' : getEscapedQuery(getWashedQuery(input.channel.trim())), 'query' : getEscapedQuery(input.channel.trim()),
}, },
}, },
}, },
@ -114,10 +114,11 @@ function getResults (input) {
}); });
return queries; return queries;
}; };
const matPhraseName = { // Match search text as phrase - Name const matPhraseName = { // Match search text as phrase - Name
'match_phrase': { 'match_phrase': {
'name': { 'name': {
'query': washedQuery, 'query': escapedQuery,
'boost': 10, 'boost': 10,
}, },
}, },
@ -168,7 +169,7 @@ function getResults (input) {
{ // Match search text as phrase - Author { // Match search text as phrase - Author
'match_phrase': { 'match_phrase': {
'value.stream.metadata.author': { 'value.stream.metadata.author': {
'query': washedQuery, 'query': escapedQuery,
'boost': 3, 'boost': 3,
}, },
}, },
@ -184,7 +185,7 @@ function getResults (input) {
{ // Match search text as phrase - Title { // Match search text as phrase - Title
'match_phrase': { 'match_phrase': {
'value.stream.metadata.title': { 'value.stream.metadata.title': {
'query': washedQuery, 'query': escapedQuery,
'boost': 3, 'boost': 3,
}, },
}, },
@ -200,7 +201,7 @@ function getResults (input) {
{ // Match search text as phrase - Description { // Match search text as phrase - Description
'match_phrase': { 'match_phrase': {
'value.stream.metadata.description': { 'value.stream.metadata.description': {
'query': washedQuery, 'query': escapedQuery,
'boost': 3, 'boost': 3,
}, },
}, },