FEATURE: Change very high/low search priority to rank at absolute ends.

Prior to this change, we had weights for very_high, high, low and
very_low. This means there were 4 weights to tweak and what weights to
use for `very_high/high` and `very_low/low` pair was hard to explain.
This change makes it such that `very_high` search priority will always
ensure that the posts are ranked at the top while `very_low` search
priority will ensure that the posts are ranked at the very bottom.
This commit is contained in:
Alan Guo Xiang Tan
2020-12-23 15:14:41 +08:00
parent 082a77df69
commit ebe4896e48
7 changed files with 80 additions and 49 deletions

View File

@ -0,0 +1,13 @@
# frozen_string_literal: true
class DeleteStaleCategorySearchPrioritiesFromSiteSettings < ActiveRecord::Migration[6.0]
def up
execute <<~SQL
DELETE FROM site_settings WHERE name IN ('category_search_priority_very_low_weight', 'category_search_priority_very_high_weight')
SQL
end
def down
raise ActiveRecord::IrreversibleMigration
end
end