Search Results for

    Show / Hide Table of Contents

    Class NpgsqlTrigramsDbFunctionsExtensions

    Provides CLR methods that get translated to database functions when used in LINQ to Entities queries. The methods on this class are accessed via .

    Inheritance
    object
    NpgsqlTrigramsDbFunctionsExtensions
    Namespace: Microsoft.EntityFrameworkCore
    Assembly: Npgsql.EntityFrameworkCore.PostgreSQL.dll
    Syntax
    public static class NpgsqlTrigramsDbFunctionsExtensions
    Remarks

    See Database functions.

    Methods

    | Improve this Doc View Source

    TrigramsAreNotStrictWordSimilar(DbFunctions, string, string)

    Commutator of the <<% operator.

    Declaration
    public static bool TrigramsAreNotStrictWordSimilar(this DbFunctions _, string source, string target)
    Parameters
    Type Name Description
    DbFunctions _
    string source
    string target
    Returns
    Type Description
    bool
    Remarks

    The method call is translated to source %>> target.

    See https://www.postgresql.org/docs/current/pgtrgm.html.

    | Improve this Doc View Source

    TrigramsAreNotWordSimilar(DbFunctions, string, string)

    Commutator of the <% operator.

    Declaration
    public static bool TrigramsAreNotWordSimilar(this DbFunctions _, string source, string target)
    Parameters
    Type Name Description
    DbFunctions _
    string source
    string target
    Returns
    Type Description
    bool
    Remarks

    The method call is translated to source %> target.

    See https://www.postgresql.org/docs/current/pgtrgm.html.

    | Improve this Doc View Source

    TrigramsAreSimilar(DbFunctions, string, string)

    Returns true if its arguments have a similarity that is greater than the current similarity threshold set by pg_trgm.similarity_threshold.

    Declaration
    public static bool TrigramsAreSimilar(this DbFunctions _, string source, string target)
    Parameters
    Type Name Description
    DbFunctions _
    string source
    string target
    Returns
    Type Description
    bool
    Remarks

    The method call is translated to source % target.

    See https://www.postgresql.org/docs/current/pgtrgm.html.

    | Improve this Doc View Source

    TrigramsAreStrictWordSimilar(DbFunctions, string, string)

    Returns true if its second argument has a continuous extent of an ordered trigram set that matches word boundaries, and its similarity to the trigram set of the first argument is greater than the current strict word similarity threshold set by the pg_trgm.strict_word_similarity_threshold parameter.

    Declaration
    public static bool TrigramsAreStrictWordSimilar(this DbFunctions _, string source, string target)
    Parameters
    Type Name Description
    DbFunctions _
    string source
    string target
    Returns
    Type Description
    bool
    Remarks

    The method call is translated to source <<% target.

    See https://www.postgresql.org/docs/current/pgtrgm.html.

    | Improve this Doc View Source

    TrigramsAreWordSimilar(DbFunctions, string, string)

    Returns true if the similarity between the trigram set in the first argument and a continuous extent of an ordered trigram set in the second argument is greater than the current word similarity threshold set by pg_trgm.word_similarity_threshold parameter.

    Declaration
    public static bool TrigramsAreWordSimilar(this DbFunctions _, string source, string target)
    Parameters
    Type Name Description
    DbFunctions _
    string source
    string target
    Returns
    Type Description
    bool
    Remarks

    The method call is translated to source <% target.

    See https://www.postgresql.org/docs/current/pgtrgm.html.

    | Improve this Doc View Source

    TrigramsShow(DbFunctions, string)

    Returns an array of all the trigrams in the given text. (In practice this is seldom useful except for debugging.)

    Declaration
    public static string[] TrigramsShow(this DbFunctions _, string text)
    Parameters
    Type Name Description
    DbFunctions _
    string text
    Returns
    Type Description
    string[]
    Remarks

    The method call is translated to show_trgm(text).

    See https://www.postgresql.org/docs/current/pgtrgm.html.

    | Improve this Doc View Source

    TrigramsSimilarity(DbFunctions, string, string)

    Returns a number that indicates how similar the two arguments are. The range of the result is zero (indicating that the two strings are completely dissimilar) to one (indicating that the two strings are identical).

    Declaration
    public static double TrigramsSimilarity(this DbFunctions _, string source, string target)
    Parameters
    Type Name Description
    DbFunctions _
    string source
    string target
    Returns
    Type Description
    double
    Remarks

    The method call is translated to similarity(source, target).

    See https://www.postgresql.org/docs/current/pgtrgm.html.

    | Improve this Doc View Source

    TrigramsSimilarityDistance(DbFunctions, string, string)

    Returns the "distance" between the arguments, that is one minus the similarity() value.

    Declaration
    public static double TrigramsSimilarityDistance(this DbFunctions _, string source, string target)
    Parameters
    Type Name Description
    DbFunctions _
    string source
    string target
    Returns
    Type Description
    double
    Remarks

    The method call is translated to source <-> target.

    See https://www.postgresql.org/docs/current/pgtrgm.html.

    | Improve this Doc View Source

    TrigramsStrictWordSimilarity(DbFunctions, string, string)

    Same as word_similarity(text, text), but forces extent boundaries to match word boundaries. Since we don't have cross-word trigrams, this function actually returns greatest similarity between first string and any continuous extent of words of the second string.

    Declaration
    public static double TrigramsStrictWordSimilarity(this DbFunctions _, string source, string target)
    Parameters
    Type Name Description
    DbFunctions _
    string source
    string target
    Returns
    Type Description
    double
    Remarks

    The method call is translated to strict_word_similarity(source, target).

    See https://www.postgresql.org/docs/current/pgtrgm.html.

    | Improve this Doc View Source

    TrigramsStrictWordSimilarityDistance(DbFunctions, string, string)

    Returns the "distance" between the arguments, that is one minus the strict_word_similarity() value.

    Declaration
    public static double TrigramsStrictWordSimilarityDistance(this DbFunctions _, string source, string target)
    Parameters
    Type Name Description
    DbFunctions _
    string source
    string target
    Returns
    Type Description
    double
    Remarks

    The method call is translated to source <<<-> target.

    See https://www.postgresql.org/docs/current/pgtrgm.html.

    | Improve this Doc View Source

    TrigramsStrictWordSimilarityDistanceInverted(DbFunctions, string, string)

    Commutator of the <<<-> operator.

    Declaration
    public static double TrigramsStrictWordSimilarityDistanceInverted(this DbFunctions _, string source, string target)
    Parameters
    Type Name Description
    DbFunctions _
    string source
    string target
    Returns
    Type Description
    double
    Remarks

    The method call is translated to source <->>> target.

    See https://www.postgresql.org/docs/current/pgtrgm.html.

    | Improve this Doc View Source

    TrigramsWordSimilarity(DbFunctions, string, string)

    Returns a number that indicates the greatest similarity between the set of trigrams in the first string and any continuous extent of an ordered set of trigrams in the second string.

    Declaration
    public static double TrigramsWordSimilarity(this DbFunctions _, string source, string target)
    Parameters
    Type Name Description
    DbFunctions _
    string source
    string target
    Returns
    Type Description
    double
    Remarks

    The method call is translated to word_similarity(source, target).

    See https://www.postgresql.org/docs/current/pgtrgm.html.

    | Improve this Doc View Source

    TrigramsWordSimilarityDistance(DbFunctions, string, string)

    Returns the "distance" between the arguments, that is one minus the word_similarity() value.

    Declaration
    public static double TrigramsWordSimilarityDistance(this DbFunctions _, string source, string target)
    Parameters
    Type Name Description
    DbFunctions _
    string source
    string target
    Returns
    Type Description
    double
    Remarks

    The method call is translated to source <<-> target.

    See https://www.postgresql.org/docs/current/pgtrgm.html.

    | Improve this Doc View Source

    TrigramsWordSimilarityDistanceInverted(DbFunctions, string, string)

    Commutator of the <<-> operator.

    Declaration
    public static double TrigramsWordSimilarityDistanceInverted(this DbFunctions _, string source, string target)
    Parameters
    Type Name Description
    DbFunctions _
    string source
    string target
    Returns
    Type Description
    double
    Remarks

    The method call is translated to source <->> target.

    See https://www.postgresql.org/docs/current/pgtrgm.html.

    • Improve this Doc
    • View Source
    In This Article
    Back to top © Copyright 2023 The Npgsql Development Team