浏览代码

Interpolate the field property in elastic search term queries (#8663)

* Interpolate the field property in elastic search term queries

* more defensive interpolation of query.field in ES templates
ajrnz 8 年之前
父节点
当前提交
43974898c1
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      public/app/plugins/datasource/elasticsearch/datasource.js

+ 3 - 0
public/app/plugins/datasource/elasticsearch/datasource.js

@@ -331,6 +331,9 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes
     this.metricFindQuery = function(query) {
       query = angular.fromJson(query);
       query.query = templateSrv.replace(query.query || '*', {}, 'lucene');
+      if ('field' in query) {
+        query.field = templateSrv.replace(query.field, {}, 'lucene');
+      }
 
       if (!query) {
         return $q.when([]);