I just started using postgreSQL for fuzzy text matching. I have two columns: job_title and company_name.
A typical full text search would concatenate job_title and company_name, then return search text result according to a single ranking.
However, treating text match in two columns equally can be problematic in my case. For example, Search Engineer at Google Co. should not be ranked equally with Google Search at Engineer Co.
I know that I can assign different weights for each column. However, I don't have a reason to weight one more important than other.
How do I match my keywords against each of the columns separately, and return some "match score" on each keywords?
Something like:
Jobs.where("(to_tsvector('english', position) @@ plainto_tsquery(:q)) AND
(to_tsvector('english',company) @@ plainto_tsquery(:q))", q: "Search Engineer", q: "Google")