Converted script scores to field_value_factor scores. This allows for a missing parameter to avoid the errors.

This commit is contained in:
Mark Beamer Jr 2019-02-24 21:41:22 -05:00
parent 101e55d924
commit 31f47fea76
No known key found for this signature in database
GPG key ID: 1C314FB89AD76973

View file

@ -65,19 +65,19 @@ function getResults (input) {
};
const funcScoreClaimWeight = { // 100 LBC adds 1 point to the score
'function_score': {
'script_score': {
'script': {
'source': `${effectiveFactor} * doc['effective_amount'].value`,
},
'field_value_factor': {
'field' : 'effective_amount',
'factor' : effectiveFactor,
'missing': 1,
},
},
};
const funcScoreChannelWeight = { // 100 LBC adds 1 point to the score
'function_score': {
'script_score': {
'script': {
'source': `${effectiveFactor} * doc['certificate_amount'].value`,
},
'field_value_factor': {
'field' : 'certificate_amount',
'factor' : effectiveFactor,
'missing': 1,
},
},
};