Explorar o código

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

Torkel Ödegaard %!s(int64=12) %!d(string=hai) anos
pai
achega
250e354659
Modificáronse 1 ficheiros con 5 adicións e 7 borrados
  1. 5 7
      src/app/services/dashboard.js

+ 5 - 7
src/app/services/dashboard.js

@@ -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(config.elasticsearch_all_disabled==true){
-        q = ('title:' + (query || '*'))
-      }else{
-        q = (query || '*')
-      }
+      // if elasticsearch has disabled _all field we need
+      // need to specifiy field here
+      var q = 'title:' + (query || '*');
+
       return request.query(
       return request.query(
         ejs.QueryStringQuery(q)
         ejs.QueryStringQuery(q)
         ).size(count).doSearch(
         ).size(count).doSearch(