Skip to content

postgrelize / trigramWordSimilarity

Function: trigramWordSimilarity() ​

trigramWordSimilarity(left, right): Fn

Defined in: src/expressions/trigram-helpers.ts:32

postgrelize extension

word_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.

unknown

Text expression, e.g. col('body').

Returns ​

Fn

Function call expression.

Example ​

ts
await Post.findAll({ attributes: [[trigramWordSimilarity('postgre', col('title')), 'score']] });

Released under the MIT License.