Skip to main content

TrigramWordSimilar

This class provides a PostgreSQL-specific lookup for word-level trigram similarity. It utilizes the "%% >" operator to determine if the trigram similarity between a field and a given string exceeds a specific threshold.

Attributes

AttributeTypeDescription
lookup_namestring = trigram_word_similarThe name of the lookup used in Django querysets to perform trigram word similarity comparisons.
postgres_operatorstring = %% >The specific PostgreSQL operator used in the SQL query to evaluate if the left-hand side is word-similar to the right-hand side.

Constructor

Signature

def TrigramWordSimilar()

Methods


trigram_word_similar()

def trigram_word_similar() - > boolean

Performs a PostgreSQL trigram word similarity comparison using the '%% >' operator to determine if the left-hand side is similar to the right-hand side.

Returns

TypeDescription
booleanTrue if the word similarity between the expressions meets the configured PostgreSQL threshold, otherwise False.