Use ts_rank_cd rather than <=>

We may want to evaluate this more later but for now I need to reduce the
number of independent variables while testing indexing changes
This commit is contained in:
Drew DeVault 2022-07-13 11:25:48 +02:00
parent 1c2252bc83
commit 8941c46191

View file

@ -37,7 +37,7 @@ func (r *queryResolver) Search(ctx context.Context, query string) ([]*model.Resu
description,
author,
excerpt,
fts_vector <=> websearch_to_tsquery('english', $1) as RANK
ts_rank_cd(fts_vector, websearch_to_tsquery('english', $1), 32) AS rank
FROM page
WHERE websearch_to_tsquery('english', $1) @@ fts_vector
ORDER BY rank DESC