[GENERAL] FTS prefix search - put full hits first - Mailing list pgsql-general

From cen
Subject [GENERAL] FTS prefix search - put full hits first
Date
Msg-id d3d4730b-2fa4-5310-6c49-d16e2cf553fa@gmail.com
Whole thread Raw
List pgsql-general
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



pgsql-general by date:

Previous
From: Alexander Shchapov
Date:
Subject: [GENERAL] Detailed progress reporting for "vacuuming indexes" stage
Next
From: "Kased, Razy (Chemistry and Geosciences)"
Date:
Subject: [GENERAL] What is the purpose of PostGIS on PostgreSQL?