# Improve recent projects search result ordering \(\#38795\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/1e70a1a4ce52ce0a32ee6b328b112579b05296c2)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 1e70a1a4ce52ce0a32ee6b328b112579b05296c2

Requested commit: 1e70a1a4ce52ce0a32ee6b328b112579b05296c2

Commit: 1e70a1a4ce52ce0a32ee6b328b112579b05296c2

Tree: f9bc79dcd96309a025d6652a7aa5e35669059b86

Author: tsjason

Committer: GitHub

## Message

```
Improve recent projects search result ordering (#38795)

Previously, search results were sorted solely by candidate_id
(preserving original order from the database), which could result in
less relevant matches appearing before better ones.

This change sorts results primarily by fuzzy match score (descending),
with candidate_id as a tiebreaker for equal scores. This ensures that
better matches appear first while preserving recency order among items
with identical scores.

Example improvement:
- Searching for 'pica' will now rank 'picabo' higher than scattered
matches like 'project-api, project-chat'
- Consecutive character matches are prioritized over scattered matches
across multiple path segments

Release Notes:
- Improved project search relevance by ranking results using match score
instead of insertion order.
```

## Parents

- [163219af356a17d1b87a7327dca81bf35bae7f2f](https://git.cafe/gitcafe/zed/commit/163219af356a17d1b87a7327dca81bf35bae7f2f?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/1e70a1a4ce52ce0a32ee6b328b112579b05296c2?format=markdown)
