You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2017/01/05 13:27:12 UTC
incubator-ponymail git commit: Simplify - use doc count from
aggregate response
Repository: incubator-ponymail
Updated Branches:
refs/heads/master 85eaeabd5 -> 23895dfb1
Simplify - use doc count from aggregate response
Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/23895dfb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/23895dfb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/23895dfb
Branch: refs/heads/master
Commit: 23895dfb18441b22a9a3e14d216940d6ba2e2ece
Parents: 85eaeab
Author: Sebb <se...@apache.org>
Authored: Thu Jan 5 13:27:00 2017 +0000
Committer: Sebb <se...@apache.org>
Committed: Thu Jan 5 13:27:00 2017 +0000
----------------------------------------------------------------------
site/api/pminfo.lua | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/23895dfb/site/api/pminfo.lua
----------------------------------------------------------------------
diff --git a/site/api/pminfo.lua b/site/api/pminfo.lua
index 7f95ff3..0859242 100644
--- a/site/api/pminfo.lua
+++ b/site/api/pminfo.lua
@@ -89,10 +89,11 @@ function handle(r)
local nal = doc.aggregations.nlists.value -- number of active lists
- -- Debug time point 2
+ local total_docs = doc.hits.total
local no_senders = doc.aggregations.cards.value
+ -- Debug time point 2
table.insert(t, r:clock() - tnow)
tnow = r:clock()
@@ -126,12 +127,10 @@ function handle(r)
},
size = MAXRESULTS
}
- local h = 0
local hits = {}
if sid then
doc, sid = elastic.scroll(sid)
while doc and doc.hits and doc.hits.hits and #doc.hits.hits > 0 do -- scroll as long as we get new results
- h = h + #doc.hits.hits
for k, v in pairs(doc.hits.hits) do
table.insert(hits, v)
end
@@ -208,7 +207,7 @@ function handle(r)
local listdata = {}
listdata.max = MAXRESULTS
listdata.no_threads = num_threads
- listdata.hits = h
+ listdata.hits = total_docs
listdata.participants = no_senders
listdata.no_active_lists = nal
listdata.took = r:clock() - now