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

humbedooh 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 1290575  address whitespace issues in IRT headers when searching for 
children by using a simple query instead of a match
1290575 is described below

commit 129057589accd47378bf617c70a1e7a1a14ad07f
Author: Daniel Gruno <[email protected]>
AuthorDate: Sun Nov 7 20:35:26 2021 +0100

    address whitespace issues in IRT headers when searching for children by 
using a simple query instead of a match
    
    also expand into utilizing the 'references' field for searching.
---
 server/plugins/messages.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/plugins/messages.py b/server/plugins/messages.py
index 8f36ffe..ca4d32a 100644
--- a/server/plugins/messages.py
+++ b/server/plugins/messages.py
@@ -225,10 +225,11 @@ async def get_email(
         if len(res["hits"]["hits"]) == 1:
             doc = res["hits"]["hits"][0]
     elif irt:
+        xirt = '"%s"' % irt.replace('"', '\\"')
         res = await session.database.search(
             index=doctype,
             size=250,
-            body={"query": {"bool": {"must": [{aggtype: {"in-reply-to": 
irt}}]}}},
+            body={"query": {"bool": {"must": [ {"simple_query_string": { 
"query": xirt, "fields":["in-reply-to", "references"]}}]}}},
         )
         docs = res["hits"]["hits"]
 

Reply via email to