mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-31 11:04:20 +01:00
refactor: if statement lexemes
This commit is contained in:
@@ -44,13 +44,13 @@ export async function getIdsBySearch(
|
||||
): Promise<Set<string>> {
|
||||
const { q, limit, offset } = opts;
|
||||
|
||||
const lexemes = await kysely.selectNoFrom(
|
||||
const [lexeme] = await kysely.selectNoFrom(
|
||||
sql`phraseto_tsquery(${q})` as unknown as SelectExpression<DittoTables, never>,
|
||||
)
|
||||
.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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user