Sample Header Ad - 728x90

Find partial match with textsearch query

0 votes
1 answer
2743 views
I have the following query that I did hard looking on this site: SELECT * FROM renns WHERE ( to_tsvector('english', coalesce(numar_admin, '')) || to_tsvector('english', coalesce(nume_strada, '')) || to_tsvector('english', coalesce(nume_prenume, ''))|| to_tsvector('english', coalesce(bloc, '')) || to_tsvector('english', coalesce(apartament, '')) ) @@ plainto_tsquery('english', '$q') It works if I write in the variable $q all the text that appears in one of the columns present in the query. For example: cherry I would like to write only: cher and return all rows fields in which it finds this string: "cher".
Asked by CoderCoder42 (101 rep)
Mar 31, 2021, 07:56 PM
Last activity: Aug 1, 2023, 06:30 PM