fuma-nama / fumadocs

The beautiful docs framework for Next.js. Alternative to Nextra
https://fumadocs.vercel.app
MIT License
1.43k stars 83 forks source link

Search not working? (flexsearch) #872

Open Bartek532 opened 1 week ago

Bartek532 commented 1 week ago

To Reproduce

  1. Visit https://turbostarter.dev/docs/web
  2. Click search box to search for something
  3. Type one letter like "a" or "e" in search box

Current vs. Expected behavior

When "web" is chosen nothing is displayed: image

But when "browser extension" is chosen, then results appear: image

They have some pages shared, so the same results should appear in both cases.

I'm using Flexsearch, but maybe I should switch to Algolia?

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.5.0: Wed May  1 20:13:18 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6030
  Available memory (MB): 18432
  Available CPU cores: 11
Binaries:
  Node: 20.17.0
  npm: 10.8.2
  Yarn: N/A
  pnpm: 9.6.0
Relevant Packages:
  next: 14.2.9 // There is a newer version (14.2.12) available, upgrade recommended! 
  eslint-config-next: N/A
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.4.5
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Core, UI, Content Sources (e.g. Fumadocs MDX, Content Collections), Integrations (e.g OpenAPI, Typescript DocsGen)

Additional context

No response

fuma-nama commented 1 week ago

probably some misspelling on tag names? I need a reproduction for that

Bartek532 commented 1 week ago

Probably not, as some search phrases are working? image

fuma-nama commented 1 week ago

image

I think it's related on how Flexsearch indexes pages, cannot help much on that, especially without the source code of your site.

It requires at least 2 characters from my observations. Since we've migrated to Orama on the dev branch, it's hard to find and fix the problem.

If it's not an urgent matter, I believe Orama doesn't have the same problem.

Bartek532 commented 1 week ago

Okay, thanks for the explanation, can I migrate to Orama quickly? Or maybe the best will be to migrate to Algolia?

fuma-nama commented 1 week ago

Orama migration is a breaking change of Fumadocs v14. For now, you can definitely migrate to Algolia Search, our docs is also using it.

Bartek532 commented 1 week ago

Okay, thanks for the info, could you tell me when Orama integration is expected to be live?

fuma-nama commented 1 week ago

Fumadocs v14 is a big update, probably October/November.