diff --git a/src/utils/search.ts b/src/utils/search.ts index 96ed9649..80228534 100644 --- a/src/utils/search.ts +++ b/src/utils/search.ts @@ -44,13 +44,13 @@ export async function getIdsBySearch( ): Promise> { const { q, limit, offset } = opts; - const lexemes = await kysely.selectNoFrom( + const [lexeme] = await kysely.selectNoFrom( sql`phraseto_tsquery(${q})` as unknown as SelectExpression, ) .execute() as { phraseto_tsquery: 'string' }[]; // if it's just stop words, don't bother making a request to the database - if (!lexemes[0].phraseto_tsquery) { + if (!lexeme.phraseto_tsquery) { return new Set(); }