From c2ff06b98d0041864ad4fe9b9b9ab9d45687d146 Mon Sep 17 00:00:00 2001 From: sakalajuraj Date: Fri, 23 Aug 2013 22:23:26 +0200 Subject: [PATCH 1/3] Update editor.html --- panels/terms/editor.html | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/panels/terms/editor.html b/panels/terms/editor.html index 982ad06159d0..5108275739a3 100644 --- a/panels/terms/editor.html +++ b/panels/terms/editor.html @@ -1,17 +1,31 @@
-
+
+ + +
+
+
+
+
+ + +
+
+ + +
-
+
-
+
From 5d6569aba941c0321453fe6ebfa077d032d11f05 Mon Sep 17 00:00:00 2001 From: sakalajuraj Date: Fri, 23 Aug 2013 22:25:45 +0200 Subject: [PATCH 2/3] Update module.js --- panels/terms/module.js | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/panels/terms/module.js b/panels/terms/module.js index cefde518bb49..5f2c062c4137 100644 --- a/panels/terms/module.js +++ b/panels/terms/module.js @@ -49,7 +49,8 @@ angular.module('kibana.terms', []) arrangement : 'horizontal', chart : 'bar', counter_pos : 'above', - spyable : true + spyable : true, + tmode : 'terms' }; _.defaults($scope.panel,_d); @@ -84,7 +85,8 @@ angular.module('kibana.terms', []) }); // Terms mode - request = request + if($scope.panel.tmode == 'terms') { + request = request .facet($scope.ejs.TermsFacet('terms') .field($scope.panel.field) .size($scope.panel.size) @@ -95,6 +97,20 @@ angular.module('kibana.terms', []) boolQuery, filterSrv.getBoolFilter(filterSrv.ids) )))).size(0); + } + if($scope.panel.tmode == 'terms_stats') { + request = request + .facet($scope.ejs.TermStatsFacet('terms') + .valueField($scope.panel.valuefield) + .keyField($scope.panel.keyfield) + .size($scope.panel.size) + .order('total') + .facetFilter($scope.ejs.QueryFilter( + $scope.ejs.FilteredQuery( + boolQuery, + filterSrv.getBoolFilter(filterSrv.ids) + )))).size(0); + } // Populate the inspector panel $scope.inspector = angular.toJson(JSON.parse(request.toString()),true); @@ -105,10 +121,17 @@ angular.module('kibana.terms', []) results.then(function(results) { var k = 0; $scope.panelMeta.loading = false; - $scope.hits = results.hits.total; + if($scope.panel.tmode == 'terms') { + $scope.hits = results.hits.total; + } $scope.data = []; _.each(results.facets.terms.terms, function(v) { + if($scope.panel.tmode == 'terms') { var slice = { label : v.term, data : [[k,v.count]], actions: true}; + } + if($scope.panel.tmode == 'terms_stats') { + var slice = { label : v.term, data : [[k,v.total]], actions: true}; + } $scope.data.push(slice); k = k + 1; }); From fd7d4d18b2f068cccb768f2568348059e8de08c7 Mon Sep 17 00:00:00 2001 From: Juraj Sakala Date: Mon, 26 Aug 2013 11:49:19 +0200 Subject: [PATCH 3/3] Update editor.html --- panels/terms/editor.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panels/terms/editor.html b/panels/terms/editor.html index 5108275739a3..0a7c39092690 100644 --- a/panels/terms/editor.html +++ b/panels/terms/editor.html @@ -1,7 +1,7 @@
- +