From c0ba96b57d15f2af7c9c9311057a4306afac677e Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Wed, 5 Apr 2017 01:50:02 +0200 Subject: [PATCH] use uncorrelated subquery for fts search term --- k9mail/src/main/java/com/fsck/k9/search/SqlQueryBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k9mail/src/main/java/com/fsck/k9/search/SqlQueryBuilder.java b/k9mail/src/main/java/com/fsck/k9/search/SqlQueryBuilder.java index 3366f0227..cfac61f73 100644 --- a/k9mail/src/main/java/com/fsck/k9/search/SqlQueryBuilder.java +++ b/k9mail/src/main/java/com/fsck/k9/search/SqlQueryBuilder.java @@ -80,7 +80,7 @@ public class SqlQueryBuilder { if (condition.attribute != Attribute.CONTAINS) { Timber.e("message contents can only be matched!"); } - query.append("(EXISTS (SELECT docid FROM messages_fulltext WHERE docid = id AND fulltext MATCH ?))"); + query.append("m.id IN (SELECT docid FROM messages_fulltext WHERE fulltext MATCH ?)"); selectionArgs.add(fulltextQueryString); break; }