Minisearch 6.0 refactor ok

This commit is contained in:
Simon Cambier
2022-11-26 12:44:20 +01:00
parent e3ac5a4bac
commit c6cee62214
11 changed files with 194 additions and 125 deletions

View File

@@ -43,7 +43,10 @@ export function markNoteForReindex(note: TAbstractFile): void {
export async function refreshIndex(): Promise<void> {
const paths = [...notesToReindex].map(n => n.path)
searchEngine.removeFromPaths(paths)
searchEngine.addFromPaths(paths)
notesToReindex.clear()
if (paths.length) {
searchEngine.removeFromPaths(paths)
searchEngine.addFromPaths(paths, false)
notesToReindex.clear()
// console.log(`Omnisearch - Reindexed ${paths.length} file(s)`)
}
}