nuxt-themes/docus

proper setting for searching with `fuse`?

xarthurx opened this issue · 8 comments

New to docus and realize that there're enough info for how to configure the search functionality.

In the documentation, only one line mentioned useFuse options, but I cannot find any example config files/settings in the app.config.ts.

How to activate the search / deactivate it?
My website have the button, but nothing shows up if I type any keyword.
image

(fuse.js is manually added to the dependencies)

I'm in the same boat. Search used to work but somehow it doesn't anymore (I'm on 1.14.6) as I'm getting the "No results found. Try another query" message

I also faced in this issue.
It was resolved by pinning @nuxt/content version to 2.7.2.

Hello, could someone provide a minimal reproduction, so that, I'll take a look?

Hello, could someone provide a minimal reproduction, so that, I'll take a look?

Even in the clean starter template search doesn't work.

Created one (with pnpm), you can check it:

https://github.com/evermake/docus-tmp-repo

I would love to debug this an create a PR to solve this issue but I'm unable to start this project on WSL.

More than 20 seconds to start Vite and Nitro never start. 😅

nuxt/nuxt#23257

The _empty field in the parsed content is returning undefined. Probably, something in nuxt content.
The easy fix is to check for it here like below and the search will work properly:

     // _empty can return undefined, so we need to check for that
     (doc?._empty === undefined || doc?._empty === false)

image

I experience exactly the same issue.

I have the documentation built using docus and the search does not work.

I am using Nuxt Content 2.8.2, docus 1.12.3.

The code can be checked here https://github.com/Baroshem/nuxt-security/tree/chore/1.0.0-rc.1