Open kvetoslavnovak opened 1 year ago
Anyway textSearch() should accept the parameter specifying the language for to_tsvector.
See https://supabase.com/docs/reference/javascript/textsearch, you can set the dictionary in the config
param.
const { data, error } = await supabase .from('quotes') .select('catchphrase') .textSearch('catchphrase',
'fat' & 'cat'
, { config: 'english' })
Thanks @kvetoslavnovak, in hindsight we should default to 'simple'
instead - we'll make the change on the next major version of the library.
Thank you very much @soedirgo . And big thank to @steve-chavez for the tip.
default to 'simple' is merged or is still use 'english' as default?
In my Supabase collection I have created to_tsvector using 'simple' parameter dictionary as I need multi languages searching. Testis in Supabase SQL editor using to_tsquery('simple', ...) work just fine.
But using client textSearch() method gives highly incorrect results.
I believe the problem and the reason is that Supabase uses only 'english' dictionary as a hidden to_tsvector parameter for textSearch() method. Is there any way how to specify in textSearch() the dictionary language parameter? I would guess 'simple' dictionary should be the default one instead. Why this "imperial English supremacy" ?
Anyway textSearch() should accept the parameter specifying the language for to_tsvector.