mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Include advanced search option to include unlisted topics in the results (#27958)
--------- Co-authored-by: Régis Hanol <regis@hanol.fr>
This commit is contained in:
@@ -935,6 +935,9 @@ class Search
|
||||
@search_context = user
|
||||
end
|
||||
|
||||
nil
|
||||
elsif word =~ /\Ainclude:(invisible|unlisted)\z/i
|
||||
@include_invisible = true
|
||||
nil
|
||||
else
|
||||
found ? nil : word
|
||||
@@ -1113,7 +1116,7 @@ class Search
|
||||
end
|
||||
|
||||
is_topic_search = @search_context.present? && @search_context.is_a?(Topic)
|
||||
posts = posts.where("topics.visible") unless is_topic_search
|
||||
posts = posts.where("topics.visible") unless is_topic_search || @include_invisible
|
||||
|
||||
if type_filter == "private_messages" || (is_topic_search && @search_context.private_message?)
|
||||
posts =
|
||||
|
||||
Reference in New Issue
Block a user