use uncorrelated subquery for fts search term
@@ -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;
}
