Improve word similarity search

This commit is contained in:
Chocobozzz 2024-09-12 09:24:28 +02:00
parent 565a11d8d3
commit f27f392721
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 1 additions and 1 deletions

View File

@ -577,7 +577,7 @@ export class VideosIdListQueryBuilder extends AbstractRunQuery {
this.cte.push(
'"trigramSearch" AS (' +
' SELECT "video"."id", ' +
` similarity(lower(immutable_unaccent("video"."name")), lower(immutable_unaccent(${escapedSearch}))) as similarity ` +
` word_similarity(lower(immutable_unaccent("video"."name")), lower(immutable_unaccent(${escapedSearch}))) as similarity ` +
' FROM "video" ' +
' WHERE lower(immutable_unaccent("video"."name")) % lower(immutable_unaccent(' + escapedSearch + ')) OR ' +
' lower(immutable_unaccent("video"."name")) LIKE lower(immutable_unaccent(' + escapedLikeSearch + '))' +