-
Notifications
You must be signed in to change notification settings - Fork 536
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
Fuzzy search of docs #1007
Fuzzy search of docs #1007
Conversation
🚀 Commit ba72bc3 Deployed on https://web-php-pr-1007.preview.thephp.foundation |
Some inline styles still need to go into CSS. Seeking feedback before marking PR as ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
I have no objections to merge this PR, let's hear what others think.
I still haven't got the fuzzy search parameters right. I think I got better matches with the original commit. I've tweaked them several times but it's hard to find a balance. Other fuzzy match libraries aren't pre-packaged as a typeahead backend, and are generally more strict. I'm aiming for enough fuzziness that people who are new to the language will have a decent chance of finding a function without knowing its name. |
Allow partial terms and multiple search tokens instead of rigid 'begins-with' substring matching.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Allow partial terms and multiple search tokens instead of rigid 'begins-with' substring matching.
This isn't perfect and could probably do with some tuning of the FuzzySearch parameters, but it's better than the current, very unforgiving, method.
It also adds the
.php
suffix to selected autocomplete results (to match the canonical tags), stops the results list from becoming inaccessible when taller than the viewport, and drops a couple of unused variables.