I'm trying to make a script within my rescore function to check if the bibliographic release date (doc['bibliografische_verschijningsdatum']), is the same as the commercial release date (doc['verschijningsdatum']).
AND the doc['verschijningsjaar'].value == new Date.getYear()
How can I get the year of todays date in painless?
"script_score": {
"script": "((doc['verschijningsdatum'] == doc['bibliografische_verschijningsdatum']) && (doc['verschijningsjaar'].value == new Date().getYear()) ? 1 : 0)"
}
}