Painless scripting Elastic Search : variable is not defined error when trying to access values from doc
问题 I am trying to learn painless scripting in Elastic Search by following the official documentation. ( https://www.elastic.co/guide/en/elasticsearch/painless/6.0/painless-examples.html ) A sample of the document I am working with : { "uid" : "CT6716617", "old_username" : "xyz", "new_username" : "abc" } the following script fields query using params._source to access document values works : { "script_fields": { "sales_price": { "script": { "lang": "painless", "source": "(params._source.old