Fix needlessly indexing unsearchable statuses into ElasticSearch (#12041)
This commit is contained in:
parent
699f53c464
commit
575dc11cb2
2 changed files with 10 additions and 8 deletions
|
@ -129,12 +129,14 @@ class Status < ApplicationRecord
|
|||
REAL_TIME_WINDOW = 6.hours
|
||||
|
||||
def searchable_by(preloaded = nil)
|
||||
ids = [account_id]
|
||||
ids = []
|
||||
|
||||
ids << account_id if local?
|
||||
|
||||
if preloaded.nil?
|
||||
ids += mentions.pluck(:account_id)
|
||||
ids += favourites.pluck(:account_id)
|
||||
ids += reblogs.pluck(:account_id)
|
||||
ids += mentions.where(account: Account.local).pluck(:account_id)
|
||||
ids += favourites.where(account: Account.local).pluck(:account_id)
|
||||
ids += reblogs.where(account: Account.local).pluck(:account_id)
|
||||
else
|
||||
ids += preloaded.mentions[id] || []
|
||||
ids += preloaded.favourites[id] || []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue