I have a query as:
select id
from events
where description is not null
and (name ilike any (query_arr)
or description ilike any (query_arr)
or additional_info ilike any (query_arr)
or venue_name ilike any (query_arr)
or other_category ilike any (query_arr)
or eventful_category ilike any (query_arr) )
And query_arr is:
{'%Tomato%','%Potato%','%Pines%'}
But now I need to match the complete word instead of ilike % sign, since it fails for a case where if the description is 'Porcupines are rodentian mammals' then the query_arr word 'pines' gets matched which is incorrect.
So I need to match the complete word itself any where in the table columns being queried.
field ~* any(array['\mTomato\M','\mPotato\M','\mPines\M']). But FTS looks promising.