mistralai / platform-docs-public

Apache License 2.0
24 stars 54 forks source link

Move to better local-search based on Pagefind #116

Open yujonglee opened 2 months ago

yujonglee commented 2 months ago

I couldn't get related pages with the current search bar of docs.mistral.ai, even for simple queries.

Screenshot 2024-07-30 at 2 06 00 PM Screenshot 2024-07-30 at 2 05 27 PM



The problem is the underlying local search index called Lunr. I agree that local search can be enough for the current size of docs, but Lunr hasn't been updated for the last 4 years and there's a better alternative called Pagefind.

After the switch from Lunr to Pagefind, I found the search results got way better.

Screenshot 2024-07-30 at 2 06 52 PM Screenshot 2024-07-30 at 2 07 23 PM

To try locally:

npx pnpm@8 i && npx docusaurus build && npx docusaurus serve

All source code related to search index and UI is MIT licensed. For UI customization, there's documentation too.

socket-security[bot] commented 2 months ago

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@getcanary/web@0.0.64 None 0 367 kB yujonglee

View full report↗︎