diff --git a/.claude/docs/docsearch-filters.md b/.claude/docs/docsearch-filters.md index 3b75c9393..b455da8e9 100644 --- a/.claude/docs/docsearch-filters.md +++ b/.claude/docs/docsearch-filters.md @@ -63,13 +63,20 @@ To add new sections: ### VuePress Configuration The DocSearch configuration in `docs/.vuepress/config.ts` includes: ```typescript -searchParameters: { - hitsPerPage: 100, - facetFilters: [`version:${setup.base}`], - facets: ['tags'] -} +indices: [ + { + name: 'prod_rundeck_docs', + searchParameters: { + hitsPerPage: 100, + facetFilters: [`version:${setup.base}`], + facets: ['tags'] + }, + }, +], ``` +`@vuepress/plugin-docsearch` rc.134+ requires `indices`. Do not use the legacy root-level `indexName` / `searchParameters`: `indices` ends up undefined and clicking Search throws `TypeError: Cannot read properties of undefined (reading 'map')`. + The `facets: ['tags']` tells Algolia to include tags as filterable attributes. ## Styling diff --git a/.claude/docs/writing-style.md b/.claude/docs/writing-style.md index 83e6ce932..4ca541296 100644 --- a/.claude/docs/writing-style.md +++ b/.claude/docs/writing-style.md @@ -43,7 +43,7 @@ Search is powered by Algolia DocSearch via `@vuepress/plugin-docsearch`. | Index name | `prod_rundeck_docs` | | Scraper | `algolia/docsearch-scraper` Docker image, driven by CircleCI | | Scraper config | `.docsearch/config.json` (selectors, start URLs, faceting attributes) | -| VuePress plugin config | `docs/.vuepress/config.ts` (`appId`, `apiKey`, `searchParameters`) | +| VuePress plugin config | `docs/.vuepress/config.ts` (`appId`, `apiKey`, `indices[].searchParameters`) | | Current facets | `version` (e.g. `docs`, `4.0.x`), `lang` | | Section tags | Applied via URL patterns in `start_urls` (Learning, User Guide, API, Administration, Developer, Release Notes, General) | @@ -52,8 +52,8 @@ The custom section-filter UI is documented in `.claude/docs/docsearch-filters.md ### When Search Won't Update - After adding new `start_urls` with tags to `.docsearch/config.json`, re-scrape the index — existing records carry stale tags until re-indexed. -- `searchParameters.facetFilters` in `docs/.vuepress/config.ts` MUST include `version:${setup.base}` so results scope correctly to the current version. -- `searchParameters.facets` MUST include `'tags'` for the filter UI to work. +- `indices[].searchParameters.facetFilters` in `docs/.vuepress/config.ts` MUST include `version:${setup.base}` so results scope correctly to the current version. +- `indices[].searchParameters.facets` MUST include `'tags'` for the filter UI to work. ## Content Directory Structure diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index 6d6f75013..625ac6103 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -128,13 +128,17 @@ export default defineUserConfig({ docsearch: { appId: 'GRSXNRCDRG', apiKey: 'c463f74d6f36a5af808650e0f69aadfa', - indexName: 'prod_rundeck_docs', + indices: [ + { + name: 'prod_rundeck_docs', + searchParameters: { + hitsPerPage: 100, + facetFilters: [`version:${setup.base}`], + facets: ['tags'] + }, + }, + ], maxResultsPerGroup: 20, - searchParameters: { - hitsPerPage: 100, - facetFilters: [`version:${setup.base}`], - facets: ['tags'] - }, locales: { '/': { placeholder: 'Search Documentation',