From 559fb24a2238b2c0b97c36c808c092dda98bb2f7 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Wed, 29 Jul 2026 19:25:32 +0530 Subject: [PATCH] fix(search): only index pages on dev updates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that dev updates actually reach the index, any changed markdown file was being ingested — including srcExclude'd include partials and dynamic route templates, which are not pages and produced dead search results. Mirror the initial scan and only index files present in siteConfig.pages. Co-Authored-By: Claude Fable 5 --- src/node/plugins/localSearchPlugin.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/node/plugins/localSearchPlugin.ts b/src/node/plugins/localSearchPlugin.ts index 2a01af56..4087daae 100644 --- a/src/node/plugins/localSearchPlugin.ts +++ b/src/node/plugins/localSearchPlugin.ts @@ -229,9 +229,13 @@ export async function localSearchPlugin( if (this.environment.name !== 'client') return if (file.endsWith('.md')) { - await indexFile(slash(path.relative(siteConfig.srcDir, file))) - debug('🔍️ Updated', file) - onIndexUpdated() + const page = slash(path.relative(siteConfig.srcDir, file)) + // only index actual pages, not includes or route templates + if (siteConfig.pages.includes(page)) { + await indexFile(page) + debug('🔍️ Updated', file) + onIndexUpdated() + } } } }