Sets tag search to use max display and storage values instead of averaging across tag domains
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 54s
Automated Main Deploy Action / build-and-deploy-docs (push) Successful in 20s

This commit is contained in:
2025-11-04 07:44:36 -05:00
parent 1e96eb3454
commit d175ef4b07

View File

@@ -30,9 +30,9 @@ drogon::Task< Json::Value > getSimilarTags(
tag_id AS tag_id,
similarity(tag_text, $2) AS similarity,
tag_text = $2 AS exact,
similarity(tag_text, $2) * avg(tc.display_count) AS score,
avg(tc.display_count) AS display_count,
avg(tc.storage_count) AS storage_count
similarity(tag_text, $2) * max(tc.display_count) AS score,
max(tc.display_count) AS display_count,
max(tc.storage_count) AS storage_count
FROM tags
LEFT JOIN tag_counts tc USING (tag_id)
WHERE tag_text LIKE $1 AND COALESCE(tc.display_count, 0) > 0