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-foal.git


The following commit(s) were added to refs/heads/master by this push:
     new d1b2c0a  Bug: use same index for both searches
d1b2c0a is described below

commit d1b2c0a206366e4c1bbf463f9fe18a68ba98de9f
Author: Sebb <[email protected]>
AuthorDate: Sat Sep 18 12:55:39 2021 +0100

    Bug: use same index for both searches
---
 server/plugins/messages.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/server/plugins/messages.py b/server/plugins/messages.py
index aa1d8b1..0f1bab8 100644
--- a/server/plugins/messages.py
+++ b/server/plugins/messages.py
@@ -458,7 +458,9 @@ async def get_years(session, query_defuzzed):
 
     # Get youngest doc
     res = await session.database.search(
-        size=1, body={"query": {"bool": query_defuzzed}, "sort": {"epoch": 
"desc"}}
+        index=session.database.dbs.mbox,
+        size=1,
+        body={"query": {"bool": query_defuzzed}, "sort": {"epoch": "desc"}}
     )
     youngest = datetime.datetime.fromtimestamp(0)
     if res["hits"]["hits"]:

Reply via email to