Skip to content

Conversation

@st0012
Copy link
Member

@st0012 st0012 commented Dec 16, 2025

Rebuild Aliki's search mechanism with a custom search index and improved ranking algorithm.

Key changes:

  • Aliki now generates its own search index (js/search_data.js) instead of using the shared JsonIndex generator (can be removed along with Darkfish in the future)
  • New search ranking algorithm with better prioritization:
    • Lowercase queries prioritize methods; uppercase queries prioritize classes/modules/constants
    • Exact matches rank higher; shorter names preferred
    • Class methods rank above instance methods (I don't have strong opinion on this one)
  • Search results now display type badges (class, module, const, method)
  • Constants are now included in search results

Closes #1497

Screenshot 2025-12-16 at 17 57 50

@matzbot
Copy link
Collaborator

matzbot commented Dec 16, 2025

🚀 Preview deployment available at: https://da19e35e.rdoc-6cd.pages.dev (commit: b255555)

@st0012 st0012 marked this pull request as ready for review December 16, 2025 18:04
@st0012 st0012 added the bug label Dec 16, 2025
@st0012 st0012 force-pushed the fix-1497-2 branch 2 times, most recently from 06dd386 to f4a8cdf Compare December 17, 2025 17:05
@tompng
Copy link
Member

tompng commented Dec 17, 2025

I don't think the current search is bad, except for the search result order and constant not searched.
It has advanced search: query = add_alias match to add_module_alias.

How about first match against full_name with regexps generated by the old searcher, and then reorder the result with score?

@st0012
Copy link
Member Author

st0012 commented Dec 17, 2025

I've updated the implementation so now these are supported:

  • Array#fil lists Array#fill, Array#filter, and Array#filter!
  • Array.try lists Array.try_convert
  • _defined? lists
    • Screenshot 2025-12-17 at 21 44 57
  • insmet lists
    • Screenshot 2025-12-17 at 22 13 26

Copy link
Member

@tompng tompng left a comment

Choose a reason for hiding this comment

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

👍

@st0012 st0012 merged commit e4e79c4 into master Dec 18, 2025
60 of 62 checks passed
@st0012 st0012 deleted the fix-1497-2 branch December 18, 2025 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Classes named like common methods are very difficult to search for

3 participants