about summary refs log tree commit diff
path: root/app/chewy
diff options
context:
space:
mode:
authorTakeshi Umeda <noel.yoshiba@gmail.com>2020-03-22 10:40:03 +0900
committerGitHub <noreply@github.com>2020-03-22 02:40:03 +0100
commit5a1fb6efc217056d3ea91f156c69684df88a8a37 (patch)
tree131d1442c163c0f57b21e5cdd627057d6aee05cd /app/chewy
parent56531d646ecd2d261740ea561afe23207416c548 (diff)
Fix bookmarks also searchable (#13293)
Diffstat (limited to 'app/chewy')
-rw-r--r--app/chewy/statuses_index.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/chewy/statuses_index.rb b/app/chewy/statuses_index.rb
index f5735421c..bec9ed88b 100644
--- a/app/chewy/statuses_index.rb
+++ b/app/chewy/statuses_index.rb
@@ -47,6 +47,11 @@ class StatusesIndex < Chewy::Index
       data.each.with_object({}) { |(id, name), result| (result[id] ||= []).push(name) }
     end
 
+    crutch :bookmarks do |collection|
+      data = ::Bookmark.where(status_id: collection.map(&:id)).where(account: Account.local).pluck(:status_id, :account_id)
+      data.each.with_object({}) { |(id, name), result| (result[id] ||= []).push(name) }
+    end
+
     root date_detection: false do
       field :id, type: 'long'
       field :account_id, type: 'long'