Rank feature library search results by match quality
What does this MR do and why?
Search results used to come out in catalog order, so features from the same category clumped together with no heading to explain why. They are now ranked by match quality and sorted within each group:
- Title exactly matches the query.
- Title starts with the query.
- Title contains the query.
- Curated synonym match (title does not contain the query): kept in the search endpoint's exact-term-first order.
- Description-only match: sorted A-Z.
Within the title groups, ties break on title length so Merge requests beats Merge request approvals. Searching merge puts Merge requests at the top; a broad query like plan matches everything weakly and reads as a plain A-Z list. The empty-search state is unchanged and still shows category headings.
References
Follow-up to #601394 (closed). Behind the default-off feature_library_modal feature flag.
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
How to set up and validate locally
- Enable the flag:
Feature.enable(:feature_library_modal) - Open the feature library modal </kbd>
- Search
merge. Merge requests should be at the top. - Search
pr. The exact-term synonym match (Merge requests) should stay on top rather than dropping below alphabetically-earlier items. - Search
plan. Should read as a plain A-Z list. - Clear the search box. Category sections unchanged.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.





