Script based order

It allows to use this clause for generate this JSON, it allows to order
by a calculated field, by example:
sort do
by_script "sin(doc['id'].value + #{day_r})", :number, :asc
end

Will generate this JSON

{
_script: {
script: "sin(doc['id'].value + #{day_r})",
type: "number",
order: "asc"
}
}