mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
feat: order search by followers count also
This commit is contained in:
parent
f063da1b86
commit
2727523540
1 changed files with 2 additions and 1 deletions
|
|
@ -10,13 +10,14 @@ export async function getPubkeysBySearch(
|
|||
const { q, limit, followedPubkeys } = opts;
|
||||
|
||||
let query = kysely
|
||||
.selectFrom('author_search')
|
||||
.selectFrom('author_stats')
|
||||
.select((eb) => [
|
||||
'pubkey',
|
||||
'search',
|
||||
eb.fn('word_similarity', [sql`${q}`, 'search']).as('sml'),
|
||||
])
|
||||
.where(() => sql`${q} <% search`)
|
||||
.orderBy(['followers_count desc'])
|
||||
.orderBy(['sml desc', 'search'])
|
||||
.limit(limit);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue