Commit 43974898 by ajrnz Committed by Torkel Ödegaard

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
parent bb3bcbe6
...@@ -331,6 +331,9 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes ...@@ -331,6 +331,9 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes
this.metricFindQuery = function(query) { this.metricFindQuery = function(query) {
query = angular.fromJson(query); query = angular.fromJson(query);
query.query = templateSrv.replace(query.query || '*', {}, 'lucene'); query.query = templateSrv.replace(query.query || '*', {}, 'lucene');
if ('field' in query) {
query.field = templateSrv.replace(query.field, {}, 'lucene');
}
if (!query) { if (!query) {
return $q.when([]); return $q.when([]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment