Integrating Full Text Search with supabase
Hi, I have few questions regarding implementation of Supabase full text search, I was reading the docs here https://supabase.com/docs/guides/database/full-text-search#to_tsvector
Currently I have custom react hook function:
I pictured an example query, if you have a look "Chicken, broiler or fryes, breast, skinless..." should've been retrieved in both queries, but is only present in the first one.
Now, I do realise that the ingredient name is very obscure and could be renamed, however as I was reading docs there were different functions mentioned such as:
to_tsvector()
to_tsquery()
@@
.
I don't understand what they do, but can they be included in supabase javascript method .textSearch()
to improve the search?
Or is it just postgres limitations and I should simply rename the ingredients 😁Full Text Search | Supabase
How to use full text search in PostgreSQL.

1 Reply
You probably want to use plain instead of phrase
This section mentions the difference when describing how websearch works:
https://supabase.com/docs/reference/javascript/textsearch#websearch
This is the Postgres description of details.
https://www.postgresql.org/docs/current/textsearch-controls.html
PostgreSQL Documentation
12.3. Controlling Text Search
12.3. Controlling Text Search 12.3.1. Parsing Documents 12.3.2. Parsing Queries 12.3.3. Ranking Search Results 12.3.4. Highlighting Results To implement full text …
textSearch() | Supabase
Only relevant for text and tsvector columns. Match only rows where