A platform for community discussion. Free, open, simple.
FIX: Avoid penalizing long documents too much in search.
Guo Xiang Tane8a4d7228159
diff --git a/lib/search.rb b/lib/search.rbindex 61b4c251e7f..fbc1e8c12ed 100644--- a/lib/search.rb+++ b/lib/search.rb@@ -836,14 +836,14 @@ class Searchposts = posts.order("posts.like_count DESC")endelse- # 2|32 divides the rank by the document length and scales the range from- # zero to one+ # 1|32 divides the rank by 1 + logarithm of the document length and+ # scales the range from zero to onedata_ranking = <<~SQL(TS_RANK_CD(post_search_data.search_data,#{ts_query(weight_filter: weights)},- 2|32+ 1|32) *(CASE categories.search_priority