Fix minor issue in searchMessages
This commit is contained in:
parent
167b2f4f1c
commit
bbf04f2fbc
1 changed files with 5 additions and 0 deletions
|
@ -1762,6 +1762,11 @@ async function searchMessages({
|
||||||
.map(token => `"${token.replace(/"/g, '""')}"*`)
|
.map(token => `"${token.replace(/"/g, '""')}"*`)
|
||||||
.join(' ');
|
.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
|
// 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
|
// 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
|
// the join rows is sorted on the fly, and this becomes substantially
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue