Thanks, the function idea is a good one. It makes the query look a lot better.
My next question is are there any obvious advantages of making the
tsvector part of the table and using a trigger to update it (or
refresh the vectors every night or something). Thanks!
Mike
On Thu, Aug 26, 2010 at
The simple answer is this:
SELECT
R.RecipeId, R.Title, R.Description, R.ImageUrl, R.Rating,
setweight(to_tsvector(title), 'A') ||
setweight(to_tsvector(coalesce(description, '')), 'B') ||
setweight(to_tsvector(coalesce(steps, '')), 'C') as vector,
ts_rank_cd(
setweight(to_tsvector(