Skip to content

postgrelize / plainToTsQuery

Function: plainToTsQuery() ​

plainToTsQuery(text, config?): Fn

Defined in: src/expressions/search-helpers.ts:111

postgrelize extension

plainto_tsquery([config,] text): ANDs all words of plain text. PostgreSQL extension.

Parameters ​

text ​

unknown

Plain text, bound as a parameter.

config? ​

string

Text search configuration; the server default when omitted.

Returns ​

Fn

Function call expression.

Throws ​

Error when config is not a plain or schema-qualified identifier.

Example ​

ts
await Post.findAll({ where: { search: { [Op.match]: plainToTsQuery('fat cats', 'english') } } });

Released under the MIT License.