Files
supabase/apps/www/pages
Francesco Sansalvadore c914163a06 Improve features search with relevance-based ranking (#48039)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Feature enhancement

## What is the current behavior?

The features page filters search results by simple substring matching,
treating all matches equally. Features are then sorted alphabetically
regardless of search relevance.

## What is the new behavior?

Search results are now ranked by relevance using a weighted scoring
system:
- Title matches starting with the search term score highest (5 points)
- Title substring matches score 4 points
- Subtitle matches score 2 points
- Description matches score 1 point

Results are sorted by relevance score (highest first), with alphabetical
ordering as a tiebreaker. This ensures users see the most relevant
features first when searching.

## Additional context

The implementation adds:
- `SEARCH_WEIGHT` constant defining the relevance weights for different
match types
- `getSearchScore()` function that calculates a feature's relevance to a
search term
- Updated filtering and sorting logic that uses relevance scoring

The weights are carefully chosen so that any title match always ranks
above features that only match in subtitle/description, improving search
quality without requiring complex algorithms.

https://claude.ai/code/session_01573vYv6WZhrboV14NQSuc4

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
  * Improved feature search with relevance-based matching.
* Search results now prioritize matches in feature titles, especially
title prefixes, followed by subtitles and descriptions.
  * Results are displayed in relevance order for faster discovery.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-07-17 17:18:06 +02:00
..
2026-07-03 15:00:43 +10:00
2026-07-03 15:00:43 +10:00
2026-07-01 12:59:00 +02:00
2024-08-28 15:06:40 +02:00
2024-08-28 15:06:40 +02:00