Browse Source

specify date format in elastic search query

Mauro Stettler 10 years ago
parent
commit
a6e8d61e8e
1 changed files with 2 additions and 1 deletions
  1. 2 1
      public/app/plugins/datasource/elasticsearch/query_builder.js

+ 2 - 1
public/app/plugins/datasource/elasticsearch/query_builder.js

@@ -10,7 +10,7 @@ function (angular) {
 
   ElasticQueryBuilder.prototype.getRangeFilter = function() {
     var filter = {};
-    filter[this.timeField] = {"gte": "$timeFrom", "lte": "$timeTo"};
+    filter[this.timeField] = {"gte": "$timeFrom", "lte": "$timeTo", "format": "epoch_millis"};
     return filter;
   };
 
@@ -127,6 +127,7 @@ function (angular) {
             "interval": this.getInterval(aggDef),
             "field": this.timeField,
             "min_doc_count": 0,
+            "format": "epoch_millis",
             "extended_bounds": { "min": "$timeFrom", "max": "$timeTo" }
           };
           break;