Explorar o código

Fix raw document query on ES 5.x

Leandro Piccilli %!s(int64=9) %!d(string=hai) anos
pai
achega
717a96ab8d

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

@@ -102,7 +102,12 @@ function (queryDef) {
     query.size = 500;
     query.sort = {};
     query.sort[this.timeField] = {order: 'desc', unmapped_type: 'boolean'};
-    query.fields = ["*", "_source"];
+
+    // fields field not supported on ES 5.x
+    if (this.esVersion < 5) {
+      query.fields = ["*", "_source"];
+    }
+
     query.script_fields = {},
     query.fielddata_fields = [this.timeField];
     return query;