Suppress search in topic unless we have more than 10 posts

(configurable in site setting)
This commit is contained in:
Sam
2014-02-19 08:59:18 +11:00
parent 18e98851e3
commit 2a8734f0d5
4 changed files with 17 additions and 0 deletions

View File

@ -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