JavaScript: textSearch
Only relevant for text and tsvector columns. Match only rows where column matches the query string in query.
Parameters
column
(Required)The text or tsvector column to filter on
query
(Required)The query text to match with
options
(Optional)Named 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'
})
