title: Is there an Elasticsearch aggregation for dates equivalent to GeoTile Grid?
body: <p>Let's say I have some time based data like this:</p>
  
  <pre><code>POST /events/_bulk?refresh
  {"index":{"_id":1}}
  {"timestamp": "2019-06-07T01:55:23.432+00:00", "type": "enter"}
  {"index":{"_id":2}}
  {"timestamp": "2019-06-07T01:58:33.100+00:00", "type": "exit"}
  {"index":{"_id":3}}
  {"timestamp": "2019-06-07T02:03:04.867+00:00", "type": "exit"}
  {"index":{"_id":4}}
  {"timestamp": "2019-06-07T02:12:11.108+00:00", "type": "enter"}
  {"index":{"_id":5}}
  {"timestamp": "2019-06-07T02:22:58.771+00:00", "type": "enter"}
  {"index":{"_id":6}}
  {"timestamp": "2019-06-07T03:37:28.844+00:00", "type": "exit"}
  </code></pre>
  
  <p>And I want to group events that happened within 15 minutes of each other, much like <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.x/search-aggregations-bucket-geotilegrid-aggregation.html" rel="nofollow noreferrer">GeoTile Grid</a> groups points that are geographically near each other.</p>
  
  <p>The resulting response would look like this:</p>
  
  <pre><code>{
      ...
      "aggregations": {
          "time-clumps": {
              "buckets": [
                  {
                    "from" : "2019-06-07T01:55:23.432+00:00",
                    "to"   : "2019-06-07T02:10:23.432+00:00",
                    "doc_count" : 3
                  },
                  {
                    "from" : "2019-06-07T02:12:11.108+00:00",
                    "to"   : "2019-06-07T02:27:11.108+00:00",
                    "doc_count" : 2
                  },
                  {
                    "from" : "2019-06-07T03:37:28.844+00:00",
                    "to"   : "2019-06-07T03:52:28.844+00:00",
                    "doc_count" : 1
                  }
              ]
          }
      }
  }
  </code></pre>
  
  <p>Is there some way to write this query in Elasticsearch?</p>