@bobfrankston/mailx-store 0.1.61 → 0.1.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/db.js +3 -3
- package/package.json +1 -1
package/db.js
CHANGED
|
@@ -2645,7 +2645,7 @@ export class MailxDB {
|
|
|
2645
2645
|
total = this.db.prepare("SELECT COUNT(*) AS c FROM messages_fts").get()?.c || 0;
|
|
2646
2646
|
}
|
|
2647
2647
|
catch { /* */ }
|
|
2648
|
-
console.log(` [db]
|
|
2648
|
+
console.log(` [db] Reindexing search index: ${total} messages in background (~5 min; substring search when done)`);
|
|
2649
2649
|
const CHUNK = 500; // ~0.35s of tokenization per chunk (measured on Bob's DB)
|
|
2650
2650
|
let last = 0, copied = 0, chunkN = 0;
|
|
2651
2651
|
const step = () => {
|
|
@@ -2665,7 +2665,7 @@ export class MailxDB {
|
|
|
2665
2665
|
copied += rows.length;
|
|
2666
2666
|
chunkN++;
|
|
2667
2667
|
if (chunkN % 40 === 0) {
|
|
2668
|
-
console.log(` [db]
|
|
2668
|
+
console.log(` [db] Reindexing search index: ${copied}/${total}`);
|
|
2669
2669
|
// The copy writes ~1 GB through the WAL in total — keep it drained.
|
|
2670
2670
|
try {
|
|
2671
2671
|
this.db.exec("PRAGMA wal_checkpoint(PASSIVE)");
|
|
@@ -2694,7 +2694,7 @@ export class MailxDB {
|
|
|
2694
2694
|
this.db.exec("DROP TABLE messages_fts");
|
|
2695
2695
|
this.db.exec("ALTER TABLE messages_fts_tri RENAME TO messages_fts");
|
|
2696
2696
|
this.db.exec("COMMIT");
|
|
2697
|
-
console.log(` [db]
|
|
2697
|
+
console.log(` [db] Search reindex complete: ${copied} messages — substring search active`);
|
|
2698
2698
|
try {
|
|
2699
2699
|
this.db.exec("PRAGMA wal_checkpoint(PASSIVE)");
|
|
2700
2700
|
}
|