-
Notifications
You must be signed in to change notification settings - Fork 447
Rebuild Aliki's searching mechanism #1504
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
base: master
Are you sure you want to change the base?
Conversation
|
🚀 Preview deployment available at: https://5ad0d5cc.rdoc-6cd.pages.dev (commit: f4a8cdf) |
|
|
||
| if (isNamespaceQuery) { | ||
| // For namespace queries like "Foo::B", match against full_name | ||
| if (!fullNameLower.startsWith(queryLower)) { |
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.
Query that contains # should also match against full_name.
For example, Array#filter should match to something but currently it doesn't.
(Search with filter in ruby/ruby's doc and press down arrow will fill Array#filter to the search form.)
| matchScore = 100; | ||
| } else { | ||
| // For regular queries, match against unqualified name (prefix match) | ||
| if (!nameLower.startsWith(queryLower)) { |
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.
I often search methods that includes query in IRB, like:
Kernel.methods.grep /_defined\?/
Can we include substring match? and prioritize lower than prefix match.
|
I don't think the current search is bad, except for the search result order and constant not searched. How about first match against full_name with regexps generated by the old searcher, and then reorder the result with score? |
Rebuild Aliki's search mechanism with a custom search index and improved ranking algorithm.
Key changes:
js/search_data.js) instead of using the shared JsonIndex generator (can be removed along with Darkfish in the future)Closes #1497