Elasticsearch ships with a simple, but powerful scripting language called Painless. And even if the origin of the name is not related to the pain of hacking C++ code in vim, it is really fun to work with it. Scripting can be used to customize Elasticsearch in many places. Sorting is one of it. Default