Skip to content

Commit

Permalink
fix: results sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanyawat-Arsaga committed Nov 24, 2023
1 parent 81f6fa7 commit 0da2db3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/jisho/jisho.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class JishoController {
`SELECT id, temp.word_id, dictionary_id, kanji, reading, entry."text" FROM (
SELECT DISTINCT word_id FROM entry WHERE ${
dictionaryId ? 'dictionary_id = $dictionary and' : ''
} instr(kanji, $term) OR instr(reading, $term) LIMIT $limit
} instr(kanji, $term) OR instr(reading, $term) ORDER BY length(entry.kanji) ASC, length(entry.reading) ASC LIMIT $limit
) as temp
LEFT JOIN entry ON entry.word_id = temp.word_id
ORDER BY length(entry.kanji) ASC, length(entry.reading) ASC`,
Expand Down

0 comments on commit 0da2db3

Please sign in to comment.