Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] replace elasticlunr with fuse.js #3

Merged
merged 2 commits into from
Jan 8, 2025
Merged

Conversation

peaBerberian
Copy link
Collaborator

We relied on the elasticlunr library for client-side documentation search.

However there's been some occurences of elasticlunr returning empty results in some cases where there are results, and search libraries are plenty so I wanted to see how its alternatives compared.

For now I've just tested with the more recent fuse.js, which doesn't have the "empty result issue" elasticlunr has.

As for elasticlunr, fuse.js is "vendored" inside the build/ directory instead of relying on Node.js's package managment and npm. This is because our client-side script isn't transformed for now, for simplicity reasons.

We could still improve on search but that's a good first step. To me having that and something like #1 could add some quick wins to README's search.

We relied on the elasticlunr library for client-side documentation search.

However there's been some occurences of elasticlunr returning empty
results in some cases where there are results, and search libraries are
plenty so I wanted to see how its alternatives compared.

For now I've just tested with the more recent fuse-js, which doesn't have
the "empty result issue" elasticlunr has.

We could still improve on search but that's a good first step.
@peaBerberian
Copy link
Collaborator Author

I've also changed "boost" values for h1 and h2 relative to h3 and body as usually people will search for an API name / title that would be expected to be at the headers' first two levels

Copy link
Collaborator

@Florent-Bouisset Florent-Bouisset left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the file name, I'm fine with this

src/create_documentation.ts Outdated Show resolved Hide resolved
@peaBerberian peaBerberian merged commit a270fd5 into main Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants