I am trying to score documents in Elasticsearch using function_score & function. I have used a custom variable in script_score and updating its value for every document.