Skip to main content

TrigramSimilar

This class provides a PostgreSQL-specific lookup operator for performing trigram similarity comparisons. It maps the trigram_similar lookup name to the %% operator, enabling database queries that filter results based on text similarity thresholds.

Attributes

AttributeTypeDescription
lookup_namestring = trigram_similarThe name of the lookup used in Django querysets to perform trigram similarity comparisons.
postgres_operatorstring = %%The specific PostgreSQL operator used in the generated SQL to evaluate trigram similarity.

Constructor

Signature

def TrigramSimilar()

Methods


trigram_similar()

def trigram_similar() - > django.db.models.lookups.Lookup

Performs a trigram similarity lookup using the PostgreSQL '%%' operator to find strings that share a sufficient number of three-character sequences.

Returns

TypeDescription
django.db.models.lookups.LookupA lookup object that can be used in Django QuerySet filters to perform trigram similarity comparisons.