Added back #81

Added back: 
Updated search query to include controlling and effective amount weights. Also made sure the results are sorted properly so highest score is at the top.
This commit is contained in:
filipnyquist 2018-08-22 16:38:15 +02:00 committed by GitHub
parent af2e3e88b9
commit b64ef9f97a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,6 +56,15 @@ function getResults (input) {
},
},
};
const funcScore = { // 100 LBC adds 1 point to the score
'function_score': {
'script_score': {
'script': {
'source': "0.00000001 * doc['effective_amount'].value",
},
},
},
};
const matPhraseName = { // Match search text as phrase - Name
'match_phrase': {
'name': {
@ -160,6 +169,7 @@ function getResults (input) {
'bool': {
'should': [
conBoost,
funcScore,
],
'must': [
channelSearch,