Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion lib/utils/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,30 @@ def self.perform_search(

search_string = search_terms.join(" ").to_s

results = ::Search.execute(search_string, search_type: :full_page, guardian: guardian)
begin
results = ::Search.execute(search_string, search_type: :full_page, guardian: guardian)
rescue Discourse::InvalidAccess => e
return(
{
args: {
search_query: search_query,
category: category,
user: user,
order: order,
max_posts: max_posts,
tags: tags,
before: before,
after: after,
status: status,
max_results: max_results,
}.compact,
rows: [],
instruction: I18n.t("invalid_access"),
error: e.message,
}
)
end

results_limit = max_results

should_try_semantic_search =
Expand Down
Loading