PDF indexing is an opt-in

This commit is contained in:
Simon Cambier
2022-09-30 22:30:41 +02:00
parent 5d1e1da45b
commit e9efed270f
4 changed files with 33 additions and 8 deletions

View File

@@ -42,7 +42,7 @@ const tokenize = (text: string): string[] => {
* Initializes the MiniSearch instance,
* and adds all the notes to the index
*/
export async function initGlobalSearchIndex(): Promise<void> {
export async function initGlobalSearchIndex(force = false): Promise<void> {
const options: Options<IndexedNote> = {
tokenize,
processTerm: (term: string) =>
@@ -76,7 +76,7 @@ export async function initGlobalSearchIndex(): Promise<void> {
}
}
if (!minisearchInstance) {
if (!minisearchInstance || force) {
minisearchInstance = new MiniSearch(options)
resetNotesCache()
}