Skip to content

Commit 0e491f4

Browse files
committed
Merge pull request rust-lang#199 from gkoz/patch-1
In a crate search query, order the results by name in addition to rank
2 parents 436893c + 675dd1a commit 0e491f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/krate.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,8 @@ pub fn index(req: &mut Request) -> CargoResult<Response> {
476476
plainto_tsquery($1) q,
477477
ts_rank_cd(textsearchable_index_col, q) rank
478478
WHERE q @@ textsearchable_index_col
479-
ORDER BY rank DESC LIMIT $2 OFFSET $3".to_string(),
479+
ORDER BY rank DESC, crates.name ASC
480+
LIMIT $2 OFFSET $3".to_string(),
480481
"SELECT COUNT(crates.*) FROM crates,
481482
plainto_tsquery($1) q
482483
WHERE q @@ textsearchable_index_col".to_string())

0 commit comments

Comments
 (0)