Search leaves out the 404 page: searchContent, the search route, MCP search_content

searchContent / listContent read Site settings once (depth 0, homepage + notFound)
and skip unlistedPageIds; createSearchRoute and the MCP route pass settingsSlug.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-29 15:31:43 +01:00
co-authored by Claude Opus 5.5
parent 3645e61f7d
commit 6b2c9b3cc6
7 changed files with 58 additions and 9 deletions
+3 -2
View File
@@ -390,7 +390,8 @@ Query: `?q=` (required), `?locale=`, `?limit=`. Response:
"results": [{ "title": "O nas", "url": "https://x/pl/o-nas", "description": "…", "slug": "o-nas" }] }
```
No `q` → 400. Published only, without `noindex` (`noindex` or `meta.noindex`),
No `q` → 400. Published only, without `noindex` (`noindex` or `meta.noindex`) and without the page assigned as the
404 page (Site settings → System pages, read through `settingsSlug`, default `site-settings`),
10 by default (`defaultLimit`), max 50 results. Under-construction mode:
pass `isPathVisible` from `createContentHelpers`, and hidden pages drop out of the results. Error/database
offline → empty result (200), not 500. **Rate limit:** 120/min per IP (in memory,
@@ -407,7 +408,7 @@ const results = await searchContent({ payload, query, config, locale, limit, bas
// SearchResult[] = { title, url, description?, slug }[]
```
`searchContent` options: `collection` (`'pages'`), `baseUrl`, `homeSlug`, `locale`
`searchContent` options: `collection` (`'pages'`), `baseUrl`, `homeSlug`, `settingsSlug` (`'site-settings'`, for the 404 page), `locale`
(default/invalid → `defaultLocale`), `limit` (10, clamped to 1–50),
`summaryField` (e.g. `'aiSummary'` — prefers the richer description from
`buildSummaryField` over `meta.description`; see [seo.md](./seo.md)). Never throws