Python: Match a string | Supabase Docs (original) (raw)

Only relevant for text and tsvector columns. Match only rows where column matches the query string in query.

Parameters

(Required)
The text or tsvector column to filter on

(Required)
The query text to match with

(Optional)
Named parameters

Examples

response = (
    supabase.table("texts")
    .select("content")
    .text_search(
        "content", 
        "'eggs' & 'ham'", 
        options={"config": "english"},
    )
    .execute()
)

Basic normalization

response = (
    supabase.table("quotes")
    .select("catchphrase")
    .text_search(
        "catchphrase",
        "'fat' & 'cat'",
        options={"type": "plain", "config": "english"},
    )
    .execute()
)

Full normalization

response = (
    supabase.table("quotes")
    .select("catchphrase")
    .text_search(
        "catchphrase",
        "'fat' & 'cat'",
        options={"type": "phrase", "config": "english"},
    )
    .execute()
)

Websearch

response = (
    supabase.table("quotes")
    .select("catchphrase")
    .text_search(
        "catchphrase",
        "'fat or cat'",
        options={"type": "websearch", "config": "english"},
    )
    .execute()
)