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 2018/10/09 20:10:49 UTC

[incubator-ponymail] branch master updated: Bug: no need to sort after scroll

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail.git


The following commit(s) were added to refs/heads/master by this push:
     new 557920c  Bug: no need to sort after scroll
557920c is described below

commit 557920c07620c786fa18d026e58396325f40c965
Author: Sebb <se...@apache.org>
AuthorDate: Tue Oct 9 21:10:47 2018 +0100

    Bug: no need to sort after scroll
    
    This fixes #477
---
 CHANGELOG.md        | 1 +
 site/api/pminfo.lua | 2 --
 site/api/stats.lua  | 2 --
 3 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5ad7760..658d174 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
 ## Changes in 0.11-SNAPSHOT
+- Bug: no need to sort after scroll (#477)
 - Enh: Ensure non-printable chars are not lost in source and mbox output (#476)
 - Enh: display buttons even if no mails are found in a month (#470)
 - Bug: Javascript URLs must always use URL_BASE (#469)
diff --git a/site/api/pminfo.lua b/site/api/pminfo.lua
index 961beaf..56f8d48 100644
--- a/site/api/pminfo.lua
+++ b/site/api/pminfo.lua
@@ -142,8 +142,6 @@ function handle(r)
             doc, sid = elastic.scroll(sid)
         end
         elastic.clear_scroll(sid) -- we're done with the sid, release it
-        -- scroll always sorts by _doc so we need to fix that
-        table.sort (hits, function (k1, k2) return k1._source.epoch > k2._source.epoch end )
     else
         local doc = elastic.raw(squery)
         hits = doc.hits.hits
diff --git a/site/api/stats.lua b/site/api/stats.lua
index a958228..bdb28f5 100644
--- a/site/api/stats.lua
+++ b/site/api/stats.lua
@@ -560,8 +560,6 @@ function handle(r)
             js, sid = elastic.scroll(sid)
         end
         elastic.clear_scroll(sid) -- we're done with the sid, release it
-		    -- ES scroll uses _doc order for efficiency; we need to sort here
-    		table.sort (dhh, function (k1, k2) return k1._source.epoch > k2._source.epoch end )
     -- otherwise, we can just do a standard raw query
     else
         local doc = elastic.raw(squery)