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 Wed, 07 Dec 2016 11:22:15 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master 7f5502e46 -> 170f5adeb


fetch only aggregation results where the hits are not needed

Missed one for #271
Also standardise on 'aggs'

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

Branch: refs/heads/master
Commit: 170f5adeb93e0751046db435acf409ecf2eaaa07
Parents: 7f5502e
Author: Sebb <sebb@apache.org>
Authored: Wed Dec 7 11:22:03 2016 +0000
Committer: Sebb <sebb@apache.org>
Committed: Wed Dec 7 11:22:03 2016 +0000

----------------------------------------------------------------------
 site/api/stats.lua | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/170f5ade/site/api/stats.lua
----------------------------------------------------------------------
diff --git a/site/api/stats.lua b/site/api/stats.lua
index 5202e22..0d19819 100644
--- a/site/api/stats.lua
+++ b/site/api/stats.lua
@@ -385,12 +385,13 @@ function handle(r)
         cloud = {}
         -- Word cloud!
         local doc = elastic.raw {
-            aggregations = {
+            size = 0, -- we don't need the hits themselves
+            aggs = {
                 subdoc = {
                     filter = {
                        limit = {value = 100} -- Max 100 x N documents used for this, otherwise
it's too slow
                    },
-                    aggregations = {
+                    aggs = {
                         cloud = {
                             significant_terms =  {
                                 field =  "subject",
@@ -424,7 +425,7 @@ function handle(r)
                 }
             }
         }
-        
+        io.stderr:write(JSON.encode(doc))
         for x,y in pairs (doc.aggregations.subdoc.cloud.buckets) do
             cloud[y.key] = y.doc_count
         end


Mime
View raw message