Commit 250e3546 by Torkel Ödegaard

Dashboard search fix, only query against title field (Closes #51,Fixes #24)

parent 2e59587c
...@@ -385,14 +385,12 @@ function (angular, $, kbn, _, config, moment, Modernizr) { ...@@ -385,14 +385,12 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
); );
}; };
this.elasticsearch_list = function(query,count) { this.elasticsearch_list = function(query, count) {
var request = ejs.Request().indices(config.grafana_index).types('dashboard'); var request = ejs.Request().indices(config.grafana_index).types('dashboard');
var q = null; // if elasticsearch has disabled _all field we need
if(config.elasticsearch_all_disabled==true){ // need to specifiy field here
q = ('title:' + (query || '*')) var q = 'title:' + (query || '*');
}else{
q = (query || '*')
}
return request.query( return request.query(
ejs.QueryStringQuery(q) ejs.QueryStringQuery(q)
).size(count).doSearch( ).size(count).doSearch(
......
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