[source, ruby]
----
response = client.search(
  index: 'sales',
  size: 0,
  body: {
    aggregations: {
      range: {
        date_range: {
          field: 'date',
          format: 'MM-yyyy',
          ranges: [
            {
              to: 'now-10M/M'
            },
            {
              from: 'now-10M/M'
            }
          ]
        }
      }
    }
  }
)
puts response
----
