fix(docs-search): restore fragment navigation and improve fuzzy search#2599
fix(docs-search): restore fragment navigation and improve fuzzy search#2599satyansh2004 wants to merge 4 commits intoHeyPuter:mainfrom
Conversation
|
hi @satyansh2004 , thanks for the PR, checking |
|
Thanks for taking a look! Please let me know if you'd like me to adjust anything or add more tests. Happy to make any changes needed. |
|
hi @satyansh2004 thank you for the PR, i have tested it, and here’s some comments requirements based on the issue:
notes:
in summary i think this PR is halfway there, its just some things are not complete yet an idea i have for the search index (doesn’t have to follow this exactly) is to index each sections (just divided per H2 is okay) instead of the entire page index structure:
more detail on the text: it should only contain the text up until the next subheading, then its considered a new document to form the final fuzzy match url we can simply do # feel free to clarify if anything’s unclear 🙏 |
|
Thanks for the detailed review! |
|
I've pushed the requested changes. The search index now chunks by H2 sections and fuzzy navigation jumps to the closest subheading while keeping existing fuzzy search and fragment matching behavior intact. Happy to adjust further if needed. |
|
hi @satyansh2004, thank you for the changes, i have reviewed and tested it, so far here are some of my comments:
|
|
Thanks for the feedback! I'll update the implementation to use Fuse's index and add matched text highlighting in the autocomplete results. Will push the changes shortly. |
|
Thanks for the suggestions! I've pushed an update that switches to Fuse's index and improves the highlighting of matched text in the search results. Everything else should behave the same as before. Happy to tweak anything further if needed. |
|
Thanks for the feedback! I’ve updated the implementation to generate the Fuse index at build time using Fuse.createIndex and serialize it to index.json. On the client side, search.js now loads the index and reconstructs it using Fuse.parseIndex. Search behavior should remain unchanged. Let me know if you'd like any adjustments. |

Related Issue
Fixes #2362
Summary
Improves the documentation search system by adding fuzzy search while preserving Puter's existing text-fragment navigation.
The goal is to make the docs search more tolerant to typos and similar terms while still allowing users to jump directly to the relevant content in the page.
Changes
title:anddescription:Testing
Tested locally using the docs development server and compared behavior with the live documentation.
Queries tested:
Verified that:
Notes
This change improves the overall search experience without altering the existing documentation structure or navigation system.