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
| Attribute | Type | Description |
|---|---|---|
| lookup_name | string = trigram_similar | The name of the lookup used in Django querysets to perform trigram similarity comparisons. |
| postgres_operator | string = %% | 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
| Type | Description |
|---|---|
django.db.models.lookups.Lookup | A lookup object that can be used in Django QuerySet filters to perform trigram similarity comparisons. |