Removed permanent wash to avoid exact match queries from failing.
This commit is contained in:
parent
7ac9900158
commit
127155ef16
1 changed files with 8 additions and 7 deletions
|
@ -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,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue