↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Functions / Text Search Functions And Operators

Assigns the specified weight to each element of the vector.

Reading PG 18current·documented in 20 of 27 versions, 8.3 to 20

Signatures & examples

setweight ( vector tsvector, weight "char" ) → tsvector
Assigns the specified weight to each element of the vector.
setweight('fat:2,4 cat:3 rat:5B'::tsvector, 'A') → 'cat':3A 'fat':2A,4A 'rat':5A
setweight ( vector tsvector, weight "char", lexemes text[] ) → tsvector
Assigns the specified weight to elements of the vector that are listed in lexemes. The strings in lexemes are taken as lexemes as-is, without further processing. Strings that do not match any lexeme in vector are ignored.
setweight('fat:2,4 cat:3 rat:5,6B'::tsvector, 'A', '{cat,rat}') → 'cat':3A 'fat':2,4 'rat':5A,6A
Version history 3
  1. 12 → 13 changed
  2. 9.5 → 9.6 changed
  3. 8.2 → 8.3 added

Definition snapshot: b7bd9cda · English manual source