Fix minor issue in searchMessages
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
parent
f777268b04
commit
694a196b2e
1 changed files with 5 additions and 0 deletions
|
@ -1762,6 +1762,11 @@ async function searchMessages({
|
|||
.map(token => `"${token.replace(/"/g, '""')}"*`)
|
||||
.join(' ');
|
||||
|
||||
// FTS5 is not happy about empty "MATCH" so short-circuit early.
|
||||
if (!normalizedQuery) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// sqlite queries with a join on a virtual table (like FTS5) are de-optimized
|
||||
// and can't use indices for ordering results. Instead an in-memory index of
|
||||
// the join rows is sorted on the fly, and this becomes substantially
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue