Commit 2e59587c by John Dyer Committed by Torkel Ödegaard

Clean up, and set default in config to false

parent 6f452025
...@@ -18,6 +18,7 @@ function (_, crypto) { ...@@ -18,6 +18,7 @@ function (_, crypto) {
panel_names : [], panel_names : [],
default_route : '/dashboard/file/default.json', default_route : '/dashboard/file/default.json',
grafana_index : 'grafana-dash', grafana_index : 'grafana-dash',
elasticsearch_all_disabled : false,
timezoneOffset : null, timezoneOffset : null,
}; };
......
...@@ -387,13 +387,13 @@ function (angular, $, kbn, _, config, moment, Modernizr) { ...@@ -387,13 +387,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(
var q = null; var q = null;
if(config.elasticsearch_all_disabled){ if(config.elasticsearch_all_disabled==true){
q = ('title:' + (query || '*')) q = ('title:' + (query || '*'))
}else{ }else{
q = (query || '*') q = (query || '*')
} }
return request.query(
ejs.QueryStringQuery(q) ejs.QueryStringQuery(q)
).size(count).doSearch( ).size(count).doSearch(
// Success // Success
......
...@@ -15,6 +15,10 @@ function (Settings) { ...@@ -15,6 +15,10 @@ function (Settings) {
*/ */
elasticsearch: "http://"+window.location.hostname+":9200", elasticsearch: "http://"+window.location.hostname+":9200",
/**
If you have _all query disabled on Elastic search then this must be set to true
https://github.com/torkelo/grafana/issues/24
**/
elasticsearch_all_disabled: false, elasticsearch_all_disabled: false,
/** /**
* graphite-web url: * graphite-web url:
......
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