ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject incubator-ponymail git commit: fetch only aggregation results where the hits are not needed
Date Tue, 06 Dec 2016 02:05:44 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master ff5ed37e0 -> 98cf3e627


fetch only aggregation results where the hits are not needed

This fixes #271

Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/98cf3e62
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/98cf3e62
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/98cf3e62

Branch: refs/heads/master
Commit: 98cf3e627f0adb6fbba29c866ca8eabe3875c616
Parents: ff5ed37
Author: Sebb <sebb@apache.org>
Authored: Tue Dec 6 02:05:28 2016 +0000
Committer: Sebb <sebb@apache.org>
Committed: Tue Dec 6 02:05:28 2016 +0000

----------------------------------------------------------------------
 site/api/pminfo.lua      | 5 ++++-
 site/api/preferences.lua | 3 +++
 site/api/static.lua      | 2 ++
 site/api/stats.lua       | 1 +
 4 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/98cf3e62/site/api/pminfo.lua
----------------------------------------------------------------------
diff --git a/site/api/pminfo.lua b/site/api/pminfo.lua
index 2f27a14..425358e 100644
--- a/site/api/pminfo.lua
+++ b/site/api/pminfo.lua
@@ -60,6 +60,7 @@ function handle(r)
     
     --[[ Get active lists ]]--
     local doc = elastic.raw {
+        size = 0, -- we don't need the hits themselves
         query = {
             
             bool = {
@@ -134,8 +135,9 @@ function handle(r)
     table.insert(t, r:clock() - tnow)
     tnow = r:clock()
     
-    --[[ Get historgram of emails ]]
+    --[[ Get histogram of emails ]]
     local doc = elastic.raw {
+        size = 0, -- we don't need the hits themselves
         aggs = {
             weekly = {
                 date_histogram = {
@@ -170,6 +172,7 @@ function handle(r)
     end
     
     local doc = elastic.raw {
+        size = 0, -- we don't need the hits themselves
         aggs = {
             from = {
                 terms = {

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/98cf3e62/site/api/preferences.lua
----------------------------------------------------------------------
diff --git a/site/api/preferences.lua b/site/api/preferences.lua
index f6540e3..d14a9df 100644
--- a/site/api/preferences.lua
+++ b/site/api/preferences.lua
@@ -217,6 +217,7 @@ Pony Mail - Email for Ponies and People.
         lists = JSON.decode(cache)
     else
         local doc = elastic.raw {
+            size = 0, -- we don't need the hits themselves
             aggs = {
                 from = {
                     terms = {
@@ -228,6 +229,7 @@ Pony Mail - Email for Ponies and People.
         }
         
         local ndoc = elastic.raw {
+            size = 0, -- we don't need the hits themselves
             aggs = {
                 from = {
                     terms = {
@@ -274,6 +276,7 @@ Pony Mail - Email for Ponies and People.
             pdoc = JSON.decode(cache)
         else
             pdoc = elastic.raw {
+            size = 0, -- we don't need the hits themselves
             aggs = {
                 from = {
                     terms = {

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/98cf3e62/site/api/static.lua
----------------------------------------------------------------------
diff --git a/site/api/static.lua b/site/api/static.lua
index b648aed..12316db 100644
--- a/site/api/static.lua
+++ b/site/api/static.lua
@@ -215,6 +215,7 @@ function handle(r)
         local dd = 90
         local daterange = {gt = "now-"..dd.."d" }
         local doc = elastic.raw {
+            size = 0, -- we don't need the hits themselves
             aggs = {
                 from = {
                     terms = {
@@ -253,6 +254,7 @@ function handle(r)
         local dd = 90
         local daterange = {gt = "now-"..dd.."d" }
         local doc = elastic.raw {
+            size = 0, -- we don't need the hits themselves
             aggs = {
                 from = {
                     terms = {

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/98cf3e62/site/api/stats.lua
----------------------------------------------------------------------
diff --git a/site/api/stats.lua b/site/api/stats.lua
index 854d950..9d2d2cd 100644
--- a/site/api/stats.lua
+++ b/site/api/stats.lua
@@ -315,6 +315,7 @@ function handle(r)
         tnow = r:clock()
         
         local doc = elastic.raw {
+            size = 0, -- we don't need the hits themselves
             aggs = {
                 from = {
                     terms = {


Mime
View raw message