[source, ruby]
----
response = client.index(
  index: 'my-index-000001',
  id: 1,
  refresh: true,
  body: {
    date: '2015-10-01T00:30:00Z'
  }
)
puts response

response = client.index(
  index: 'my-index-000001',
  id: 2,
  refresh: true,
  body: {
    date: '2015-10-01T01:30:00Z'
  }
)
puts response

response = client.index(
  index: 'my-index-000001',
  id: 3,
  refresh: true,
  body: {
    date: '2015-10-01T02:30:00Z'
  }
)
puts response

response = client.search(
  index: 'my-index-000001',
  size: 0,
  body: {
    aggregations: {
      by_day: {
        auto_date_histogram: {
          field: 'date',
          buckets: 3
        }
      }
    }
  }
)
puts response
----
