fix(plugin-search): reset search index cache (#603)

This commit is contained in:
pengzhanbo 2025-05-21 22:54:33 +08:00 committed by GitHub
parent 1e98061021
commit 7592eafd38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,6 +49,9 @@ export async function prepareSearchIndex({
searchOptions,
}: SearchIndexOptions): Promise<void> {
const start = performance.now()
indexByLocales.clear()
indexCache.clear()
const pages = isSearchable ? app.pages.filter(isSearchable) : app.pages
await pMap(pages, p => indexFile(p, searchOptions), {
concurrency: 64,