Changes to template based queries

Hi, I'm trying to upgrade from ES 1.7.3 to 2.3.3. I'm mostly done, however I've run into some issues trying to convert one of my templated queries to work in 2.3.3. This is the query, only changes are to obscure some attributes.

{
  "_source": [
    "record.openedDate",
    "record.typeName",
    "record.fields.Title",
    "record.canceled"
  ],
  "sort": [
    "record.typeName",
    "record.openedDate"
  ],
  "size" : 1000,
  "query": {
    "filtered": {
      "query": {
        "match_all": {}
      },
      "filter": {
        "and": {
          "filters": [
            {
              "range": {
                "record.openedDate": {
                  "from": "{{from}}"
                }
              }
            },
            {
              "bool": {
                "must": {
                  "term": {
                    "record.canceled": "false"
                  }
                }
              }
            }
          ]
        }
      }
    }
  },
  "aggs": {
    "openedMonth": {
      "date_histogram": {
        "field": "record.openedDate",
        "interval": "month"
      },
      "aggs": {
        "byType": {
          "terms": {
            "field": "_type"
          }
        }
      }
    }
  }
}

I get quite a few errors. ES complains that _source, sort, size and aggs shouldn't be there. If they shouldn't be here, where do they go?