Обсуждение: [GENERAL] FTS prefix search - put full hits first

Поиск
Список
Период
Сортировка

[GENERAL] FTS prefix search - put full hits first

От
cen
Дата:
Hi

I have this FTS query:

SELECT * FROM receivers r WHERE r.tsv @@ unaccent('john:*')::tsquery
ORDER BY ts_rank(r.tsv, unaccent('john:*')::tsquery) DESC;

Is there any way to tell FTS to put records with "John" first and others
after that (Johhny, Johnson etc)?

Basically, I want to have full word hits on top.


Best regards, Klemen