Remove extraneous greatest from search score functions

This commit is contained in:
Matt Jankowski 2024-09-12 09:41:54 -04:00
parent c35ea59ee6
commit ca6bee3b49

View file

@ -15,15 +15,15 @@ module Account::Search
REPUTATION_SCORE_FUNCTION = <<~SQL.squish
(
greatest(0, coalesce(s.followers_count, 0)) / (
greatest(0, coalesce(s.following_count, 0)) + 1.0
coalesce(s.followers_count, 0) / (
coalesce(s.following_count, 0) + 1.0
)
)
SQL
FOLLOWERS_SCORE_FUNCTION = <<~SQL.squish
log(
greatest(0, coalesce(s.followers_count, 0)) + 2
coalesce(s.followers_count, 0) + 2
)
SQL