[Discover/Fields] Changed the logic to check if the current index Patterns time field is the one we're trying to visualize

This commit is contained in:
Khalah Jones-Golden 2015-03-27 13:39:22 -07:00
parent 4821f6d70d
commit 8b10cccf37

View file

@ -128,7 +128,7 @@ define(function (require) {
var type = isGeoPoint ? 'tile_map' : 'histogram';
// If we're visualizing a date field, and our index is time based (and thus has a time filter),
// then run a date histogram
if (field.type === 'date' && field.indexed && $scope.indexPattern.timeFieldName) {
if (field.type === 'date' && $scope.indexPattern.timeFieldName === field.name) {
agg = {
type: 'date_histogram',
schema: 'segment',