[source, ruby]
----
response = client.search(
  index: 'sales',
  size: 0,
  body: {
    aggregations: {
      range: {
        date_range: {
          field: 'date',
          missing: '1976/11/30',
          ranges: [
            {
              key: 'Older',
              to: '2016/02/01'
            },
            {
              key: 'Newer',
              from: '2016/02/01',
              to: 'now/d'
            }
          ]
        }
      }
    }
  }
)
puts response
----
