karmi/retire — pull request #970 by mrkaspa (2014-07-18 00:18:35+00:00)
Title: 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"
}
}