Elastic search aggregation with sort
<p>How to use sort with aggregation?
Here is my request, but response isn't sorted.</p>

<pre><code>{
  "from":0,
  "size":4,
  "query":{
    "bool":{
      "must":[
        {
          "match":{
            "currentStatus":"published"
          }
        },
        {
          "match":{
            "type":"time_and_material"
          }
        }
      ]
    }
  },
  "sort":[
    {
      "createdAt":{
        "order":"desc"
      }
    }
  ]
}
</code></pre>

<p>How request must bee look like?</p>