DEV: Add hidden site setting for PG search ranking normalization.
This commit is contained in:
parent
ecc799ab56
commit
af52df2d96
|
@ -1730,6 +1730,9 @@ backups:
|
|||
hidden: true
|
||||
|
||||
search:
|
||||
search_ranking_normalization:
|
||||
default: '1'
|
||||
hidden: true
|
||||
search_inject_extra_terms:
|
||||
default: true
|
||||
hidden: true
|
||||
|
|
|
@ -937,14 +937,12 @@ class Search
|
|||
posts = posts.order("posts.like_count DESC")
|
||||
end
|
||||
else
|
||||
# 1|32 divides the rank by 1 + logarithm of the document length and
|
||||
# scales the range from zero to one
|
||||
data_ranking = <<~SQL
|
||||
(
|
||||
TS_RANK_CD(
|
||||
post_search_data.search_data,
|
||||
#{ts_query(weight_filter: weights)},
|
||||
1|32
|
||||
#{Sitesetting.search_ranking_normalization}|32
|
||||
) *
|
||||
(
|
||||
CASE categories.search_priority
|
||||
|
|
Loading…
Reference in New Issue