瀏覽代碼

Merge branch 'patch-1' of https://github.com/goldeelox/grafana into goldeelox-patch-1

Torkel Ödegaard 8 年之前
父節點
當前提交
68397d342b
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      public/app/plugins/datasource/elasticsearch/query_builder.js

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

@@ -119,8 +119,12 @@ function (queryDef) {
       query.fields = ["*", "_source"];
     }
 
-    query.script_fields = {},
-    query.docvalue_fields = [this.timeField];
+    query.script_fields = {};
+    if (this.esVersion < 5) {
+      query.fielddata_fields = [this.timeField];
+    } else {
+      query.docvalue_fields = [this.timeField];
+    }
     return query;
   };