Added reverted changes back in
This commit is contained in:
parent
525da56606
commit
5a9ce272b9
2 changed files with 18 additions and 6 deletions
|
@ -63,12 +63,21 @@ function getResults (input) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const funcScore = { // 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
|
||||||
|
'function_score': {
|
||||||
|
'field_value_factor': {
|
||||||
|
'field' : 'certificate_amount',
|
||||||
|
'factor' : effectiveFactor,
|
||||||
|
'missing': 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -176,7 +185,8 @@ function getResults (input) {
|
||||||
'bool': {
|
'bool': {
|
||||||
'should': [
|
'should': [
|
||||||
conBoost,
|
conBoost,
|
||||||
funcScore,
|
funcScoreClaimWeight,
|
||||||
|
funcScoreChannelWeight,
|
||||||
],
|
],
|
||||||
'must': [
|
'must': [
|
||||||
channelSearch,
|
channelSearch,
|
||||||
|
|
|
@ -172,12 +172,14 @@ function getClaimsSince (time, lastID, MaxClaimsInCall) {
|
||||||
`p.name as channel,` +
|
`p.name as channel,` +
|
||||||
`c.bid_state,` +
|
`c.bid_state,` +
|
||||||
`c.effective_amount,` +
|
`c.effective_amount,` +
|
||||||
|
`COALESCE(p.effective_amount,1) as certificate_amount,` +
|
||||||
`c.claim_id as claimId,` +
|
`c.claim_id as claimId,` +
|
||||||
`c.value_as_json as value ` +
|
`c.value_as_json as value ` +
|
||||||
`FROM claim c ` +
|
`FROM claim c ` +
|
||||||
`LEFT JOIN claim p on p.claim_id = c.publisher_id ` +
|
`LEFT JOIN claim p on p.claim_id = c.publisher_id ` +
|
||||||
`WHERE c.id >` + lastID + ` ` +
|
`WHERE c.id >` + lastID + ` ` +
|
||||||
`AND c.modified_at >='` + time + `' ` +
|
`AND c.modified_at >='` + time + `' ` +
|
||||||
|
`ORDER BY c.id ` +
|
||||||
`LIMIT ` + MaxClaimsInCall;
|
`LIMIT ` + MaxClaimsInCall;
|
||||||
// Outputs full query to console for copy/paste into chainquery (debugging)
|
// Outputs full query to console for copy/paste into chainquery (debugging)
|
||||||
// console.log(query);
|
// console.log(query);
|
||||||
|
|
Loading…
Add table
Reference in a new issue