Skip to content
masterclass Buddy

PostgreSQL · Type Alias

tsvector

PostgreSQL full-text search uses tsvector for searchable documents and tsquery for search expressions. Convert raw text with the parsing functions, then use @@ to test for matches.

Last updated

Syntax

to_tsvector([ config regconfig, ] document text) returns tsvector; to_tsquery([ config regconfig, ] querytext text) returns tsquery; tsvector @@ tsquery

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • tsquery
  • to_tsvector
  • to_tsquery
  • plainto_tsquery
  • phraseto_tsquery
  • websearch_to_tsquery
  • setweight
  • ts_rank

Source: PostgreSQL: Documentation: 18: 8.11. Text Search Types. Checked 2026-11-03.