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

This commit is contained in:
John Dyer
2014-01-31 09:17:37 -05:00
committed by Torkel Ödegaard
parent b939c02da0
commit 6f4520254b
2 changed files with 8 additions and 1 deletions

View File

@@ -388,7 +388,13 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
this.elasticsearch_list = function(query,count) {
var request = ejs.Request().indices(config.grafana_index).types('dashboard');
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(
// Success
function(result) {

View File

@@ -15,6 +15,7 @@ function (Settings) {
*/
elasticsearch: "http://"+window.location.hostname+":9200",
elasticsearch_all_disabled: false,
/**
* graphite-web url:
* For Basic authentication use: http://username:password@domain.com