postgrelize / trigramWordSimilarity
Function: trigramWordSimilarity() ​
trigramWordSimilarity(
left,right):Fn
Defined in: src/expressions/trigram-helpers.ts:32
postgrelize extensionword_similarity(a, b) of pg_trgm: similarity of a to the best matching part of b. PostgreSQL extension.
Parameters ​
left ​
unknown
Text expression or value, the searched word.
right ​
unknown
Text expression, e.g. col('body').
Returns ​
Function call expression.
Example ​
ts
await Post.findAll({ attributes: [[trigramWordSimilarity('postgre', col('title')), 'score']] });