Search hooks for each provider
fumadocs-core/search/client exports a hook for each search client, like useFetchSearch(). They return the props of <SearchDialog />:
const search = useFetchSearch({ locale });
<SearchDialog {...search} {...props}>
<SearchDialogList />
</SearchDialog>;data is the last successful search, its items have their content parsed into hastContent. error is set when the last search failed.
experimental_useSearch()creates a search hook from a memoized search function.useDocsSearch()is deprecated.useFlexsearchStatic()anduseOramaCloudLegacySearch()are exported from the paths of their clients.<SearchDialogList />showsdefaultItemswithout results.useSearchList()is removed,useSearch()returnsgetActive(),setActive()andsubscribeActive()for the active item.<SearchDialogListItem />renders adivinstead of abutton, table rows render their cells only.renderMarkdownof<SearchDialogListItem />renderscontentinstead ofhastContent. Without it, the string content of custom items is shown as text.- The templates of Fumadocs CLI and Create Fumadocs App use the new hooks.
Sync Mixedbread stores with sync()
sync()andtoDocuments()fromfumadocs-core/search/mixedbreadupload a file for each page, whose chunks are its title, headings and paragraphs. Results link to their headings and render tables like other search integrations.- Stores synced with
mxbai store syncneed a re-sync, the frontmatter of pages is no longer read. - Tag filters match the tags of pages,
localefilters results by language, and thelimitof requests can only lowertopK. - The Mixedbread template of Fumadocs CLI syncs a pre-rendered
static.jsonwithsync(), debounces searches by 300 ms, and reads the API key fromMXBAI_API_KEY.