From e95e57797159e863207db4763ef03f2309b6e4e0 Mon Sep 17 00:00:00 2001
From: Colin Goodheart-Smithe <colings86@users.noreply.github.com>
Date: Thu, 24 Mar 2016 16:21:11 +0000
Subject: [PATCH] Don't use extended_bounds for time filter in date_histogram
 vis

The date histogram vis currently uses extended_bounds on the date_histogram if a time filter is applied which means that these requests can't be cached since the cache key for the request cache for Elasticsearch is based on the request body. The `extended_bounds` here has no effect on the response of the date histogram aggregation because it also sets minDocCount to 0 so will not return any empty buckets.

This change removes the extended bounds parameter for the time filter so these requests can be cached by Elasticsearch.
---
 src/ui/public/agg_types/buckets/date_histogram.js | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/src/ui/public/agg_types/buckets/date_histogram.js b/src/ui/public/agg_types/buckets/date_histogram.js
index 485ce7e664d09..d25b4c5786fe9 100644
--- a/src/ui/public/agg_types/buckets/date_histogram.js
+++ b/src/ui/public/agg_types/buckets/date_histogram.js
@@ -150,14 +150,6 @@ export default function DateHistogramAggType(timefilter, config, Private) {
 
             return;
           }
-
-          var bounds = timefilter.getActiveBounds();
-          if (bounds) {
-            output.params.extended_bounds = {
-              min: moment(bounds.min).valueOf(),
-              max: moment(bounds.max).valueOf()
-            };
-          }
         }
       }
     ]