From 6f4520254b50e91b04334ad533bf886253bbdd94 Mon Sep 17 00:00:00 2001 From: John Dyer Date: Fri, 31 Jan 2014 09:17:37 -0500 Subject: [PATCH] Make search support elastic search clusters with _all disabled. Feature is disabled by default --- src/app/services/dashboard.js | 8 +++++++- src/config.js | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/app/services/dashboard.js b/src/app/services/dashboard.js index 14a3e53d3f2..aca885c3a90 100644 --- a/src/app/services/dashboard.js +++ b/src/app/services/dashboard.js @@ -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) { diff --git a/src/config.js b/src/config.js index d26bee82c69..a5cb7a30d34 100644 --- a/src/config.js +++ b/src/config.js @@ -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