ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [incubator-ponymail] branch master updated: Bug: no need to sort after scroll
Date Wed, 10 Oct 2018 23:22:57 GMT
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 b9f6bbd  Bug: no need to sort after scroll
b9f6bbd is described below

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

    Bug: no need to sort after scroll
    
    This fixes #477
    (reapply)
---
 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 7ea7a8d..46ffb8f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
 ## Changes in 0.11-SNAPSHOT
 - Bug: elastic.lua#scroll forces sort to use _doc (#478)
 - Bug: cannot download more than 10K mails to a mbox file (#475)
+- 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)


Mime
View raw message