From 2838a3cc2a63c9ca32e56f0e25ae77fb50061812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C4=85tkowski?= Date: Sun, 7 Aug 2022 23:27:32 +0200 Subject: [PATCH] Improve PostgreSQL serach a little --- pkg/persistence/postgres.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/persistence/postgres.go b/pkg/persistence/postgres.go index 82734e4..3665c25 100644 --- a/pkg/persistence/postgres.go +++ b/pkg/persistence/postgres.go @@ -236,7 +236,7 @@ func (db *postgresDatabase) QueryTorrents( {{ end }} {{ if and .QueryExists .FirstPage }} WHERE {{ end }} {{ if .QueryExists }} - to_tsvector(replace(replace(name, '.', ' '), '-', ' ')) @@ plainto_tsquery('{{ .Query }}') + to_tsvector(replace(replace(name, '.', ' '), '-', ' ')) @@ websearch_to_tsquery('{{ .Query }}') {{ end }} ORDER BY {{.OrderOn}} {{AscOrDesc .Ascending}} LIMIT {{.Limit}};