Skip to content
masterclass Buddy

PostgreSQL · Function

to_tsvector

to_tsvector converts document text into a searchable tsvector. It normalizes words, removes stop words, and records lexeme positions using a text search configuration.

Last updated

Syntax

to_tsvector([ config regconfig, ] document text) returns tsvector

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

Subscribe
  • tsvector
  • tsquery
  • to_tsquery
  • plainto_tsquery
  • phraseto_tsquery
  • websearch_to_tsquery
  • setweight
  • @@

Source: PostgreSQL: Documentation: 18: 12.3. Controlling Text Search. Checked 2026-11-03.