mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 19:17:18 +08:00
Suppress search in topic unless we have more than 10 posts
(configurable in site setting)
This commit is contained in:
@ -46,6 +46,10 @@ class Search
|
||||
@search_context = @opts[:search_context]
|
||||
@limit = Search.per_facet * Search.facets.size
|
||||
@results = GroupedSearchResults.new(@opts[:type_filter])
|
||||
|
||||
if Topic === @search_context && @search_context.posts_count < SiteSetting.min_posts_for_search_in_topic
|
||||
@search_context = nil
|
||||
end
|
||||
end
|
||||
|
||||
# Query a term
|
||||
|
Reference in New Issue
Block a user