Commit 6f452025 by John Dyer Committed by Torkel Ödegaard

Make search support elastic search clusters with _all disabled. Feature is disabled by default

parent b939c02d
...@@ -388,7 +388,13 @@ function (angular, $, kbn, _, config, moment, Modernizr) { ...@@ -388,7 +388,13 @@ 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');
return request.query( return request.query(
ejs.QueryStringQuery(query || '*') var q = null;
if(config.elasticsearch_all_disabled){
q = ('title:' + (query || '*'))
}else{
q = (query || '*')
}
ejs.QueryStringQuery(q)
).size(count).doSearch( ).size(count).doSearch(
// Success // Success
function(result) { function(result) {
......
...@@ -15,6 +15,7 @@ function (Settings) { ...@@ -15,6 +15,7 @@ function (Settings) {
*/ */
elasticsearch: "http://"+window.location.hostname+":9200", elasticsearch: "http://"+window.location.hostname+":9200",
elasticsearch_all_disabled: false,
/** /**
* graphite-web url: * graphite-web url:
* For Basic authentication use: http://username:password@domain.com * For Basic authentication use: http://username:password@domain.com
......
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