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:

  1. Title exactly matches the query.
  2. Title starts with the query.
  3. Title contains the query.
  4. Curated synonym match (title does not contain the query): kept in the search endpoint's exact-term-first order.
  5. 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
CleanShot_2026-08-10_at_12.11.44_2x CleanShot 2026-08-10 at 22.00.45@2x.png
CleanShot_2026-08-10_at_12.11.26_2x CleanShot 2026-08-10 at 22.00.54@2x.png
CleanShot_2026-08-10_at_12.11.34_2x CleanShot 2026-08-10 at 22.00.59@2x.png

How to set up and validate locally

  1. Enable the flag: Feature.enable(:feature_library_modal)
  2. Open the feature library modal </kbd>
  3. Search merge. Merge requests should be at the top.
  4. Search pr. The exact-term synonym match (Merge requests) should stay on top rather than dropping below alphabetically-earlier items.
  5. Search plan. Should read as a plain A-Z list.
  6. 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.

Edited by Austin Regnery

Merge request reports

Loading