Alternative for flags in terms aggregation

Following is the aggregation query valid in ES 1.4:

"aggregations": {
  "links": {
    "terms": {
      "script": "<user_defined_script>",
      "size": 0,
      "shard_size": 0,
      "include": {
        "pattern": "<user_defined_pattern>",
        "flags": 2
      }
    }
  }
}

Following is the same query that I used in ES 2.1.1:

"aggregations": {
  "links": {
    "terms": {
      "script": {
        "inline": "<user_defined_script>"
      },
      "size": 0,
      "shard_size": 0,
      "include": {
        "pattern": "<user_defined_pattern>",
        "flags": 2
      }
    }
  }
}

but I noticed that flags has been removed from ES 2.0+ releases.

So, are there any alternatives in ES 2.0+ for such an aggregation?