From 7ee1c00cb836b0c1ffe33a11da70ed29235dc5c2 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 4 Nov 2022 08:15:03 +0100 Subject: [PATCH] FTS index without content --- app/src/main/java/eu/faircode/email/DaoMessage.java | 3 +-- app/src/main/java/eu/faircode/email/WorkerFts.java | 9 +++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/DaoMessage.java b/app/src/main/java/eu/faircode/email/DaoMessage.java index 7f53ef8161..6a75c7e9dd 100644 --- a/app/src/main/java/eu/faircode/email/DaoMessage.java +++ b/app/src/main/java/eu/faircode/email/DaoMessage.java @@ -334,8 +334,7 @@ public interface DaoMessage { @Transaction @Query("SELECT message.id FROM message" + " JOIN folder_view AS folder ON folder.id = message.folder" + - " WHERE content" + - " AND NOT fts" + + " WHERE NOT fts" + " AND folder.type <> '" + EntityFolder.OUTBOX + "'" + " ORDER BY message.received") Cursor getMessageFts(); diff --git a/app/src/main/java/eu/faircode/email/WorkerFts.java b/app/src/main/java/eu/faircode/email/WorkerFts.java index b09bf7e7ba..9309c5b78e 100644 --- a/app/src/main/java/eu/faircode/email/WorkerFts.java +++ b/app/src/main/java/eu/faircode/email/WorkerFts.java @@ -81,10 +81,11 @@ public class WorkerFts extends Worker { continue; } - File file = message.getFile(context); - String text = HtmlHelper.getFullText(file); - if (text == null) - text = ""; + String text = null; + if (message.content) { + File file = message.getFile(context); + text = HtmlHelper.getFullText(file); + } try { sdb.beginTransaction();