should i use supabase text search or algolia?

I need a basic varchar text search for finding rows from my db. There's textSearch option in supabase
33 Replies
jdgamble555
jdgamble5553y ago
100% don't use a second database if you don't need one. The supabase text search is definitely sufficient for most needs. - https://code.build/p/6KPQqmE2wsVdYaRZiAVDzF/supabase-fuzzy-full-text-search
Supabase Fuzzy Full Text Search - Code.Build
Full Text Search Postgres supports many full-text search options. Your options include:- [LIKE](https://www.postgresql.
Nisthar
NistharOP3y ago
i did this
Nisthar
NistharOP3y ago
No description
Nisthar
NistharOP3y ago
any idea why its not working?
Nisthar
NistharOP3y ago
No description
Nisthar
NistharOP3y ago
i am getting this as the result
jdgamble555
jdgamble5553y ago
are you using sdk v2?
Nisthar
NistharOP3y ago
"dependencies": {
"@supabase/auth-helpers-sveltekit": "^0.7.1",
"@supabase/supabase-js": "^1.35.7",
"dependencies": {
"@supabase/auth-helpers-sveltekit": "^0.7.1",
"@supabase/supabase-js": "^1.35.7",
this is the version i am using i think its the latest version
jdgamble555
jdgamble5553y ago
It works with certain queries? I am using the RC v2 js sdk, so not sure if that matters here
Nisthar
NistharOP3y ago
wdym certain queries? the normal selects, inserts works fine
jdgamble555
jdgamble5553y ago
so what doesn't work?
Nisthar
NistharOP3y ago
this one
jdgamble555
jdgamble5553y ago
So the query "cet g" does not work? but everything else does?
Nisthar
NistharOP3y ago
yeah only the textSearch function is not working its the text i am searching for nope still not working
Nisthar
NistharOP3y ago
No description
Nisthar
NistharOP3y ago
i think spaces are not working are you using spaces in your phrases?
jdgamble555
jdgamble5553y ago
try .textSearch('title', query, { type: 'phrase' });
Nisthar
NistharOP3y ago
No description
Nisthar
NistharOP3y ago
it works but its not returning anything
Nisthar
NistharOP3y ago
No description
Nisthar
NistharOP3y ago
i have this in my table even typing the whole thing doesn't return anything
jdgamble555
jdgamble5553y ago
does 'cet' work?
Nisthar
NistharOP3y ago
no
Nisthar
NistharOP3y ago
No description
jdgamble555
jdgamble5553y ago
what does your full query look like in js?
Nisthar
NistharOP3y ago
No description
Nisthar
NistharOP3y ago
like this
jdgamble555
jdgamble5553y ago
I'm wondering if you need to make the varchar a text field, or if you need to add an index like this:
CREATE INDEX groups_index ON public.groups USING gin (to_tsvector('simple'::regconfig, name))
CREATE INDEX groups_index ON public.groups USING gin (to_tsvector('simple'::regconfig, name))
or similar I honestly have no idea at this point, this should work unless it is one of those two things... Or you're leaving something out... oh, change to.select('*')... see if that helps
Nisthar
NistharOP3y ago
I tried adding a text column for testing Its the same
jdgamble555
jdgamble5553y ago
try creating an index on it, not sure if that is necessary supabase js sdk uses postgrest under-the-hood, so not sure if this can help you - https://postgrest.org/en/stable/api.html?highlight=full%20text#full-text-search
Nisthar
NistharOP3y ago
Thanks man! It was a stupid mistake on my part
jdgamble555
jdgamble5553y ago
What was it?
Nisthar
NistharOP3y ago
its not fixed yet i thought it was the rls but it wasn't ok its fixed now it was a combination of some other things like rls, filters Thanks again!

Did you find this page helpful?