Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Update search API to handle multiple i18n languages

Bill Yang3113fb0b378f
diff --git a/docs/src/app/api/search/route.ts b/docs/src/app/api/search/route.ts
index ec24acdce..4b34615c0 100644
--- a/docs/src/app/api/search/route.ts
+++ b/docs/src/app/api/search/route.ts
@@ -7,6 +7,15 @@ import { createFromSource } from 'fumadocs-core/search/server';
export const revalidate = false;
export const { staticGET: GET } = createFromSource(source, {
+ // The source declares 10 i18n languages, so search builds one index per
+ // locale. Orama has no stemmer for these languages, which throws
+ // `Language "<x>" is not supported` and breaks the static index export.
+ // The docs are English-only, so fall back to the English tokenizer for them.
// https://docs.orama.com/open-source/supported-languages
- language: 'english',
+ localeMap: {
+ zh: 'english',
+ pl: 'english',
+ ko: 'english',
+ ja: 'english',
+ },
});