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 const funcScoreClaimWeight = { // 100 LBC adds 1 point to the score
'function_score': { 'function_score': {
'script_score': { 'field_value_factor': {
'script': { 'field' : 'effective_amount',
'source': `${effectiveFactor} * doc['effective_amount'].value`, 'factor' : effectiveFactor,
}, 'missing': 1,
}, },
}, },
}; };
const funcScoreChannelWeight = { // 100 LBC adds 1 point to the score const funcScoreChannelWeight = { // 100 LBC adds 1 point to the score
'function_score': { 'function_score': {
'script_score': { 'field_value_factor': {
'script': { 'field' : 'certificate_amount',
'source': `${effectiveFactor} * doc['certificate_amount'].value`, 'factor' : effectiveFactor,
}, 'missing': 1,
}, },
}, },
}; };