I’m trying to modify the score by multiplying with aggregation but it is returning a “null” value for new_score
[
{
'$search': {
'index': 'default',
'text': {
'query': 'Dinosaur',
'path': 'title'
}
}
}, {
'$project': {
'title': 1,
'awards': '$awards.wins',
'score': {
'$meta': 'searchScore'
},
'new_score': {
'$multiply': [
'$score', '$awards'
]
}
}
}
]
Output of the aggregation
{
"_id": {
"$oid": "573a139bf29313caabcf33d0"
},
"title": "Dinosaur",
"awards": 4,
"score": 5.398964881896973,
"new_score": null
}