I don't enough about Painless to actually help you out here, but looking at the API reference, it seems like you might be able to specify a custom format using the DateTImeFormatter.
Unfortunately, the output does not comply with the local week definitions.
If time zone is set to "Europe/Copenhagen" in the suggested script then the week changes between Saturday and Sunday although by definition a new week begins on Mondays in Denmark.
How should the script be adjusted to end up with a week definition valid in the time zone used in the scripted field?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.