about summary refs log tree commit diff
path: root/app/services/search_service.rb
diff options
context:
space:
mode:
authorAboobacker MK <aboobacker@redpanthers.co>2018-03-04 00:15:06 +0530
committerEugen Rochko <eugen@zeonfederated.com>2018-03-03 19:45:06 +0100
commit49092945ab86725180e202945ae1bec03a32a634 (patch)
tree6844e57a3735b91bc9c92ca65e9af609a350aeeb /app/services/search_service.rb
parentc82a2358bd051fb5313abd04de0722e12d4ebc07 (diff)
Fix 500 while searching after deleting a post (#6604)
Fixes #6602
Diffstat (limited to 'app/services/search_service.rb')
-rw-r--r--app/services/search_service.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/services/search_service.rb b/app/services/search_service.rb
index fe9856686..00a8b3dd7 100644
--- a/app/services/search_service.rb
+++ b/app/services/search_service.rb
@@ -29,7 +29,9 @@ class SearchService < BaseService
   def perform_statuses_search!
     statuses = StatusesIndex.filter(term: { searchable_by: account.id })
                             .query(multi_match: { type: 'most_fields', query: query, operator: 'and', fields: %w(text text.stemmed) })
-                            .limit(limit).objects
+                            .limit(limit)
+                            .objects
+                            .compact
 
     statuses.reject { |status| StatusFilter.new(status, account).filtered? }
   end