mirror of
https://github.com/discourse/discourse.git
synced 2025-02-08 04:18:23 +00:00
FIX: Add time retention limit to search logs
3 years is a very conservative limit that allows for a very wide buffer for year-over-year analysis. The max is set to 5 years because that is the policy listed for logging in hosted Discourse.
This commit is contained in:
parent
1de0ef137e
commit
38a8e52ca4
@ -134,6 +134,7 @@ class SearchLog < ActiveRecord::Base
|
|||||||
if search_id.present?
|
if search_id.present?
|
||||||
SearchLog.where('id < ?', search_id[0]).delete_all
|
SearchLog.where('id < ?', search_id[0]).delete_all
|
||||||
end
|
end
|
||||||
|
SearchLog.where('created_at < TIMESTAMP ?', SiteSetting.search_query_log_max_retention_days.days.ago).delete_all
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1069,6 +1069,7 @@ en:
|
|||||||
search_recent_posts_size: "How many recent posts to keep in the index"
|
search_recent_posts_size: "How many recent posts to keep in the index"
|
||||||
log_search_queries: "Log search queries performed by users"
|
log_search_queries: "Log search queries performed by users"
|
||||||
search_query_log_max_size: "Maximum amount of search queries to keep"
|
search_query_log_max_size: "Maximum amount of search queries to keep"
|
||||||
|
search_query_log_max_retention_days: "Maximum amount of time to keep search queries, in days. Default is 3 years (1095 days)."
|
||||||
allow_uncategorized_topics: "Allow topics to be created without a category. WARNING: If there are any uncategorized topics, you must recategorize them before turning this off."
|
allow_uncategorized_topics: "Allow topics to be created without a category. WARNING: If there are any uncategorized topics, you must recategorize them before turning this off."
|
||||||
allow_duplicate_topic_titles: "Allow topics with identical, duplicate titles."
|
allow_duplicate_topic_titles: "Allow topics with identical, duplicate titles."
|
||||||
unique_posts_mins: "How many minutes before a user can make a post with the same content again"
|
unique_posts_mins: "How many minutes before a user can make a post with the same content again"
|
||||||
|
@ -1362,6 +1362,9 @@ search:
|
|||||||
search_query_log_max_size:
|
search_query_log_max_size:
|
||||||
default: 1000000
|
default: 1000000
|
||||||
max: 1000000
|
max: 1000000
|
||||||
|
search_query_log_max_retention_days:
|
||||||
|
default: 1095 # 3 years
|
||||||
|
max: 1825 # 5 years
|
||||||
|
|
||||||
uncategorized:
|
uncategorized:
|
||||||
version_checks:
|
version_checks:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user