30
Nov
Recently, I encountered a problem with full-text search. I am using this feature in my search input, where the backend sends hints of possible matches as you type. The backend database is PostgreSQL. I needed the hints to be ranked by the position of the searched term in the text. Full Text Search in PostgreSQL Full-text search in PostgreSQL can be achieved quite easily. There are two main tools to use: tsvector - represents a searchable document. tsquery - represents the search query to perform against a document. Let’s say we want to search the titles of our blog posts.…