Elasticsearch date histogram aggregation on a duration of time -
the documents deal in elasticsearch have concept of duration represented start , end time, e.g. { issueid: 1, issuepriority: 3, timewindow: { start: "2015-10-14t17:00:00-07:00", end: "2015-10-14t18:00:00-07:00" } }, { issueid: 2, issuepriority: 1, timewindow: { start: "2015-10-14t16:50:00-07:00", end: "2015-10-14t17:50:00-07:00" } } my goal produce histogram number of issues , max priority aggregated 15 minute buckets. example above issue #1 bucketized 17:00 , 17:15 , 17:30 , , 17:45 buckets, no more, no less. i tried using date_histogram aggregation, e.g: aggs: { max_priority_over_time: { date_histogram: { field: "timewindow.start", interval: "15minute", }, aggs: { max_priority: ${top_hits_aggregation} } } } but bucketizing issue #1 17:00 bucket. if take timewindow.end account added 18:00 bucket. know how can accomplish using date_histo...