From 000299666dc24ec7c35558bb79e4f2c1f23b2233 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Tue, 21 Jan 2025 11:58:06 +0800 Subject: [PATCH] fix(plugin-search): incorrect local search results (#434) --- docs/changelog.md | 1 + docs/contributing.md | 1 + docs/demos.md | 1 + docs/sponsor.md | 1 + .../plugin-search/src/client/components/SearchBox.vue | 2 +- .../src/client/components/SearchButton.vue | 11 +++++------ plugins/plugin-search/src/node/prepareSearchIndex.ts | 8 +++++++- 7 files changed, 17 insertions(+), 8 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index aa82f8037..4374d4075 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -10,6 +10,7 @@ comment: false editLink: false contributors: false changelog: false +search: false --- diff --git a/docs/contributing.md b/docs/contributing.md index 93ba62330..492f7646b 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -8,6 +8,7 @@ readingTime: false editLink: false contributors: false changelog: false +search: false --- diff --git a/docs/demos.md b/docs/demos.md index 8c295ad8e..8c81d1fd2 100644 --- a/docs/demos.md +++ b/docs/demos.md @@ -10,6 +10,7 @@ draft: true externalLinkIcon: false contributors: false changelog: false +search: false docs: - name: VuePress Plume diff --git a/docs/sponsor.md b/docs/sponsor.md index cc4ecbe9f..13a70733d 100644 --- a/docs/sponsor.md +++ b/docs/sponsor.md @@ -7,6 +7,7 @@ aside: false readingTime: false contributors: false changelog: false +search: false --- :::important 作者的话 diff --git a/plugins/plugin-search/src/client/components/SearchBox.vue b/plugins/plugin-search/src/client/components/SearchBox.vue index 8fd288ce0..700553fc9 100644 --- a/plugins/plugin-search/src/client/components/SearchBox.vue +++ b/plugins/plugin-search/src/client/components/SearchBox.vue @@ -120,7 +120,7 @@ debouncedWatch( // Search results.value = index .search(filterTextValue) - .slice(0, 16) + // .slice(0, 16) .map((r) => { r.titles = r.titles?.filter(Boolean) || [] return r diff --git a/plugins/plugin-search/src/client/components/SearchButton.vue b/plugins/plugin-search/src/client/components/SearchButton.vue index 4555e4b07..cbc3a3b98 100644 --- a/plugins/plugin-search/src/client/components/SearchButton.vue +++ b/plugins/plugin-search/src/client/components/SearchButton.vue @@ -13,12 +13,7 @@ const locale = useLocale(toRef(props.locales))