We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c0a2d4c commit adc2716Copy full SHA for adc2716
lib/utils/search.rb
@@ -34,7 +34,30 @@ def self.perform_search(
34
35
search_string = search_terms.join(" ").to_s
36
37
- results = ::Search.execute(search_string, search_type: :full_page, guardian: guardian)
+ begin
38
+ results = ::Search.execute(search_string, search_type: :full_page, guardian: guardian)
39
+ rescue Discourse::InvalidAccess => e
40
+ return(
41
+ {
42
+ args: {
43
+ search_query: search_query,
44
+ category: category,
45
+ user: user,
46
+ order: order,
47
+ max_posts: max_posts,
48
+ tags: tags,
49
+ before: before,
50
+ after: after,
51
+ status: status,
52
+ max_results: max_results,
53
+ }.compact,
54
+ rows: [],
55
+ instruction: I18n.t("invalid_access"),
56
+ error: e.message,
57
+ }
58
+ )
59
+ end
60
+
61
results_limit = max_results
62
63
should_try_semantic_search =
0 commit comments