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

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 + '))' +