#104 - Refactored search history to use IndexedDB

This commit is contained in:
Simon Cambier
2022-10-22 16:37:31 +02:00
parent 8696f1381d
commit 9eed978e8a
9 changed files with 75 additions and 72 deletions

View File

@@ -6,18 +6,13 @@ class OmnisearchCache extends Dexie {
{ path: string; hash: string; size: number; text: string },
string
>
documents!: Dexie.Table<
{ document: IndexedDocument; path: string; mtime: number },
string
>
minisearch!: Dexie.Table<string>
searchHistory!: Dexie.Table<{ id?: number; query: string }, number>
constructor() {
super(app.appId + '_omnisearch')
this.version(2).stores({
this.version(3).stores({
pdf: 'path, hash, size, text',
documents: 'path, mtime, document',
minisearch: 'data',
searchHistory: '++id, query',
})
}
}