JavaScript: Match a string

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

Parameters

Examples

Text search

const result = await supabase
  .from("texts")
  .select("content")
  .textSearch("content", `'eggs' & 'ham'`, {
    config: "english",
  });

Basic normalization

const { data, error } = await supabase
  .from('quotes')
  .select('catchphrase')
  .textSearch('catchphrase', `'fat' & 'cat'`, {
    type: 'plain',
    config: 'english'
  })

Full normalization

const { data, error } = await supabase
  .from('quotes')
  .select('catchphrase')
  .textSearch('catchphrase', `'fat' & 'cat'`, {
    type: 'phrase',
    config: 'english'
  })

Websearch

const { data, error } = await supabase
  .from('quotes')
  .select('catchphrase')
  .textSearch('catchphrase', `'fat or cat'`, {
    type: 'websearch',
    config: 'english'
  })