postgrelize / toTsVector
Function: toTsVector() ​
toTsVector(
document,config?):Fn
Defined in: src/expressions/search-helpers.ts:79
postgrelize extensionto_tsvector([config,] document): parses a document into a tsvector. PostgreSQL extension.
Parameters ​
document ​
unknown
Text value (bound as a parameter) or an expression such as col('body').
config? ​
string
Text search configuration; the server default when omitted.
Returns ​
Function call expression.
Throws ​
Error when config is not a plain or schema-qualified identifier.
Example ​
ts
await Post.findAll({ where: where(toTsVector(col('body'), 'english'), Op.match, websearchToTsQuery('cat -dog', 'english')) });