mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-10 22:41:29 +08:00
When searching for a chat, results were returned in a fixed order (users → groups → DMs → channels) without considering how well they matched the search term. This meant searching for "dev" could show 10 users named "developer" or "devops" before the actual #dev channel. Results are now sorted by match quality first, then by type: 1. Exact matches (name equals search term) 2. Prefix matches (name starts with search term) 3. Partial matches (name contains search term) Within each match tier, channels appear before users/groups, and users with chat enabled appear before those with chat disabled. This ensures that searching "dev" shows the #dev channel first, followed by a user named "dev", then "dev-talk" channel, and so on. Ref - t/124487 **BEFORE** <img width="1573" height="1396" alt="BEFORE" src="https://github.com/user-attachments/assets/8e4bb827-9418-400c-ac16-fb35631d772a" /> **AFTER** <img width="1573" height="1396" alt="AFTER" src="https://github.com/user-attachments/assets/418d24a8-05d7-4146-8473-fa3be2f3415f" /> |
||
|---|---|---|
| .. | ||
| acceptance | ||
| components | ||
| helpers | ||
| integration | ||
| unit | ||
| chat-fixtures.js | ||