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

commit d779c25fcd3ea2d927608fe553999c3be09cdb59
Author: Daniel Gruno <[email protected]>
AuthorDate: Sun Oct 17 17:43:26 2021 +0200

    add in shortening of body in migrator
---
 tools/migrate.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/migrate.py b/tools/migrate.py
index ab19fa8..e288330 100644
--- a/tools/migrate.py
+++ b/tools/migrate.py
@@ -198,6 +198,9 @@ def process_document(old_es, doc, old_dbname, 
dbname_source, dbname_mbox, do_dki
     source["_source"]["permalinks"] = doc["_source"]["permalinks"]
     doc["_source"]["dbid"] = hashlib.sha3_256(source_text).hexdigest()
 
+    # Add in shortened body for search aggs
+    doc["_source"]["body_short"] = doc["_source"]["body"][:210]
+
     # Add in gravatar
     header_from = doc["_source"]["from"]
     mailaddr = email.utils.parseaddr(header_from)[1]

Reply via email to