Browse Source

Annotation: filter field is not interpreting in elasticsearch query, Fixes #661

Torkel Ödegaard 11 years ago
parent
commit
918ea5d12f
2 changed files with 3 additions and 1 deletions
  1. 1 0
      CHANGELOG.md
  2. 2 1
      src/app/services/elasticsearch/es-datasource.js

+ 1 - 0
CHANGELOG.md

@@ -5,6 +5,7 @@
 - [Issue #450](https://github.com/grafana/grafana/issues/450). Graph: Tooltip does not disappear sometimes and would get stuck
 - [Issue #450](https://github.com/grafana/grafana/issues/450). Graph: Tooltip does not disappear sometimes and would get stuck
 - [Issue #655](https://github.com/grafana/grafana/issues/655). General: Auto refresh not initiated / started after dashboard loading
 - [Issue #655](https://github.com/grafana/grafana/issues/655). General: Auto refresh not initiated / started after dashboard loading
 - [Issue #657](https://github.com/grafana/grafana/issues/657). General: Fix for refresh icon in IE browsers
 - [Issue #657](https://github.com/grafana/grafana/issues/657). General: Fix for refresh icon in IE browsers
+- [Issue #661](https://github.com/grafana/grafana/issues/661). Annotations: Elasticsearch querystring with filter template replacements was not interpolated
 
 
 # 1.7.0-rc1 (2014-08-05)
 # 1.7.0-rc1 (2014-08-05)
 
 

+ 2 - 1
src/app/services/elasticsearch/es-datasource.js

@@ -73,8 +73,9 @@ function (angular, _, $, config, kbn, moment) {
         to: rangeUnparsed.to,
         to: rangeUnparsed.to,
       };
       };
 
 
+      var queryInterpolated = filterSrv.applyTemplateToTarget(queryString);
       var filter = { "bool": { "must": [{ "range": range }] } };
       var filter = { "bool": { "must": [{ "range": range }] } };
-      var query = { "bool": { "should": [{ "query_string": { "query": queryString } }] } };
+      var query = { "bool": { "should": [{ "query_string": { "query": queryInterpolated } }] } };
       var data = { "query" : { "filtered": { "query" : query, "filter": filter } }, "size": 100 };
       var data = { "query" : { "filtered": { "query" : query, "filter": filter } }, "size": 100 };
 
 
       return this._request('POST', '/_search', annotation.index, data).then(function(results) {
       return this._request('POST', '/_search', annotation.index, data).then(function(results) {