mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 23:56:01 +08:00
FEATURE: support search click through tracking for user, category and tags
https://meta.discourse.org/t/search-logs-page/73281/11?u=techapj This commit adds following features: - support for tracking click through to user, tag and category - new filter for search type (header, full page) This commit also removes "most viewed topic" field from search logs page because we are now tracking multiple click through entities, so topic is not a special entity anymore. This also improves query perf. The query now takes `20.5ms` to runs, as opposed to `655.9ms` previously.
This commit is contained in:
@ -0,0 +1,13 @@
|
||||
class RenameClickedTopicIdToSearchResultId < ActiveRecord::Migration[5.1]
|
||||
def up
|
||||
rename_column :search_logs, :clicked_topic_id, :search_result_id
|
||||
add_column :search_logs, :search_result_type, :integer, null: true
|
||||
|
||||
execute "UPDATE search_logs SET search_result_type = 1 WHERE search_result_id is NOT NULL"
|
||||
end
|
||||
|
||||
def down
|
||||
rename_column :search_logs, :search_result_id, :clicked_topic_id
|
||||
remove_column :search_logs, :search_result_type
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user