Explicit ES import when AP status or account is created or updated
This commit is contained in:
parent
98c9bc52c0
commit
87b5f7f485
5 changed files with 9 additions and 2 deletions
|
@ -85,6 +85,8 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
attach_tags(@status)
|
||||
end
|
||||
|
||||
StatusesIndex.import! @status
|
||||
|
||||
resolve_thread(@status)
|
||||
fetch_replies(@status)
|
||||
distribute
|
||||
|
|
|
@ -25,7 +25,8 @@ class Importer::StatusesIndexImporter < Importer::BaseImporter
|
|||
# on the results of the filter, so this filtering happens here instead
|
||||
bulk.map! do |entry|
|
||||
new_entry = begin
|
||||
if entry[:index] && entry.dig(:index, :data, 'searchable_by').blank?
|
||||
if entry[:index] && entry.dig(:index, :data, 'searchable_by').blank? &&
|
||||
Rails.configuration.x.search_scope == :classic
|
||||
{ delete: entry[:index].except(:data) }
|
||||
else
|
||||
entry
|
||||
|
|
|
@ -73,6 +73,8 @@ class ActivityPub::ProcessAccountService < BaseService
|
|||
set_fetchable_attributes! unless @options[:only_key] || @account.suspended?
|
||||
|
||||
@account.save_with_optional_media!
|
||||
|
||||
AccountsIndex.import! @account
|
||||
end
|
||||
|
||||
def set_immediate_protocol_attributes!
|
||||
|
|
|
@ -50,6 +50,8 @@ class ActivityPub::ProcessStatusUpdateService < BaseService
|
|||
|
||||
reset_preview_card!
|
||||
broadcast_updates!
|
||||
|
||||
StatusesIndex.import! @status
|
||||
end
|
||||
|
||||
forward_activity! if significant_changes? && @status_parser.edited_at > last_edit_date
|
||||
|
|
|
@ -40,7 +40,7 @@ class SearchService < BaseService
|
|||
when :public
|
||||
statuses_index = statuses_index.filter.or(term: { visibility: 'public' })
|
||||
when :public_or_unlisted
|
||||
statuses_index = statuses_index.filter.or(term: { visibility: ['public', 'unlisted'] })
|
||||
statuses_index = statuses_index.filter.or(terms: { visibility: ['public', 'unlisted'] })
|
||||
end
|
||||
definition = parsed_query.apply(statuses_index)
|
||||
|
||||
|
|
Loading…
Reference in a new issue